diff --git a/.gitignore b/.gitignore index 5ae2dd25..f453a613 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,3 @@ project.index ## Sublime sublime-* sftp-config.json -tests/phan/issues diff --git a/.phan/config.php b/.phan/config.php new file mode 100644 index 00000000..aa85e632 --- /dev/null +++ b/.phan/config.php @@ -0,0 +1,30 @@ +scribunto_engine + 'PhanUndeclaredProperty', + ] +); + +return $cfg; diff --git a/Scribunto.php b/Scribunto.php index e75bab9d..a990b257 100644 --- a/Scribunto.php +++ b/Scribunto.php @@ -1,5 +1,5 @@ validate( $title ); if ( $validateStatus->isOK() ) { return true; diff --git a/includes/engines/LuaCommon/LuaCommon.php b/includes/engines/LuaCommon/LuaCommon.php index 0faa1b3d..827e3bcd 100644 --- a/includes/engines/LuaCommon/LuaCommon.php +++ b/includes/engines/LuaCommon/LuaCommon.php @@ -567,7 +567,7 @@ abstract class Scribunto_LuaEngine extends ScribuntoEngineBase { $module = $this->fetchModuleFromParser( $title ); if ( $module ) { - /** @suppress PhanUndeclaredMethod */ + // @phan-suppress-next-line PhanUndeclaredMethod return [ $module->getInitChunk() ]; } else { return []; @@ -1045,27 +1045,27 @@ class Scribunto_LuaError extends ScribuntoException { } if ( strval( $info['namewhat'] ) !== '' ) { - $function = wfMessage( 'scribunto-lua-in-function', wfEscapeWikiText( $info['name'] ) ); + $functionMsg = wfMessage( 'scribunto-lua-in-function', wfEscapeWikiText( $info['name'] ) ); in_array( 'content', $msgOptions ) ? - $function = $function->inContentLanguage()->plain() : - $function = $function->plain(); + $function = $functionMsg->inContentLanguage()->plain() : + $function = $functionMsg->plain(); } elseif ( $info['what'] == 'main' ) { - $function = wfMessage( 'scribunto-lua-in-main' ); + $functionMsg = wfMessage( 'scribunto-lua-in-main' ); in_array( 'content', $msgOptions ) ? - $function = $function->inContentLanguage()->plain() : - $function = $function->plain(); + $function = $functionMsg->inContentLanguage()->plain() : + $function = $functionMsg->plain(); } else { // C function, tail call, or a Lua function where Lua can't // guess the name $function = '?'; } - $backtraceLine = wfMessage( 'scribunto-lua-backtrace-line' ) + $backtraceLineMsg = wfMessage( 'scribunto-lua-backtrace-line' ) ->rawParams( "$src" ) ->params( $function ); in_array( 'content', $msgOptions ) ? - $backtraceLine = $backtraceLine->inContentLanguage()->parse() : - $backtraceLine = $backtraceLine->parse(); + $backtraceLine = $backtraceLineMsg->inContentLanguage()->parse() : + $backtraceLine = $backtraceLineMsg->parse(); $s .= "