From b2b2c26bd19dcc816872207175120f2543b6feaf Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 30 Jul 2016 23:03:53 +0200 Subject: [PATCH] Do not dynamically call static methods --- .../install/files/lib/system/WCF.class.php | 10 +-- .../files/lib/system/WCFSetup.class.php | 10 +-- .../lib/system/benchmark/Benchmark.class.php | 2 +- .../files/lib/system/io/ZipWriter.class.php | 4 +- .../lib/system/mail/DebugMailSender.class.php | 2 +- .../TemplateScriptingCompiler.class.php | 82 +++++++++---------- .../AppendCompilerTemplatePlugin.class.php | 8 +- .../AssignCompilerTemplatePlugin.class.php | 8 +- .../FetchCompilerTemplatePlugin.class.php | 4 +- .../ImplodeCompilerTemplatePlugin.class.php | 4 +- .../LangCompilerTemplatePlugin.class.php | 2 +- .../PagesFunctionTemplatePlugin.class.php | 6 +- .../PrependCompilerTemplatePlugin.class.php | 6 +- 13 files changed, 74 insertions(+), 74 deletions(-) diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 55e84187aa..abcc054b92 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -457,7 +457,7 @@ class WCF { // TODO: what exactly should the base href represent and how should it be calculated, also because // defining it here eventually breaks the ACP due to tpl initialization occurs first if (!class_exists(WCFACP::class, false)) { - $this->getTPL()->assign('baseHref', self::$applications['wcf']->getPageURL()); + static::getTPL()->assign('baseHref', self::$applications['wcf']->getPageURL()); } // start main application @@ -545,13 +545,13 @@ class WCF { // register template path if not within ACP if (!class_exists('wcf\system\WCFACP', false)) { // add template path and abbreviation - $this->getTPL()->addApplication($abbreviation, $packageDir . 'templates/'); + static::getTPL()->addApplication($abbreviation, $packageDir . 'templates/'); } EmailTemplateEngine::getInstance()->addApplication($abbreviation, $packageDir . 'templates/'); // init application and assign it as template variable self::$applicationObjects[$application->packageID] = call_user_func([$className, 'getInstance']); - $this->getTPL()->assign('__'.$abbreviation, self::$applicationObjects[$application->packageID]); + static::getTPL()->assign('__'.$abbreviation, self::$applicationObjects[$application->packageID]); EmailTemplateEngine::getInstance()->assign('__'.$abbreviation, self::$applicationObjects[$application->packageID]); } else { @@ -561,11 +561,11 @@ class WCF { // register template path in ACP if (class_exists('wcf\system\WCFACP', false)) { - $this->getTPL()->addApplication($abbreviation, $packageDir . 'acp/templates/'); + static::getTPL()->addApplication($abbreviation, $packageDir . 'acp/templates/'); } else if (!$isDependentApplication) { // assign base tag - $this->getTPL()->assign('baseHref', $application->getPageURL()); + static::getTPL()->assign('baseHref', $application->getPageURL()); } // register application diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index 5743ef87ae..821aa7c527 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -89,14 +89,14 @@ class WCFSetup extends WCF { public function __construct() { @set_time_limit(0); - $this->getDeveloperMode(); - $this->getLanguageSelection(); - $this->getInstallationDirectories(); + static::getDeveloperMode(); + static::getLanguageSelection(); + static::getInstallationDirectories(); $this->initLanguage(); $this->initTPL(); /** @noinspection PhpUndefinedMethodInspection */ self::getLanguage()->loadLanguage(); - $this->getPackageNames(); + static::getPackageNames(); // start setup $this->setup(); @@ -541,7 +541,7 @@ class WCFSetup extends WCF { } // WCF not yet installed, install files first else { - $this->installFiles(); + static::installFiles(); $this->gotoNextStep('selectLanguages'); } diff --git a/wcfsetup/install/files/lib/system/benchmark/Benchmark.class.php b/wcfsetup/install/files/lib/system/benchmark/Benchmark.class.php index 23564f684a..50a82df961 100644 --- a/wcfsetup/install/files/lib/system/benchmark/Benchmark.class.php +++ b/wcfsetup/install/files/lib/system/benchmark/Benchmark.class.php @@ -89,7 +89,7 @@ class Benchmark extends SingletonFactory { * @return float */ public function getExecutionTime() { - return $this->compareMicrotimes($this->startTime, self::getMicrotime()); + return self::compareMicrotimes($this->startTime, self::getMicrotime()); } /** diff --git a/wcfsetup/install/files/lib/system/io/ZipWriter.class.php b/wcfsetup/install/files/lib/system/io/ZipWriter.class.php index e0061df083..379c3f790e 100644 --- a/wcfsetup/install/files/lib/system/io/ZipWriter.class.php +++ b/wcfsetup/install/files/lib/system/io/ZipWriter.class.php @@ -57,7 +57,7 @@ class ZipWriter { $record .= "\x00\x00\x0a\x00"; $record .= "\x00\x00\x00\x00"; //$record .= "\x00\x00\x00\x00"; - $record .= $this->getDosDatetime($date); + $record .= static::getDosDatetime($date); $record .= pack("V", 0); $record .= pack("V", 0); $record .= pack("V", 0); @@ -131,7 +131,7 @@ class ZipWriter { $record = "\x50\x4b\x01\x02"; $record .= "\x00\x00\x14\x00"; $record .= "\x00\x00\x08\x00"; - $record .= $this->getDosDatetime($date); + $record .= static::getDosDatetime($date); $record .= pack("V", $crc); $record .= pack("V", $sizeCompressed); $record .= pack("V", $sizeUncompressed); diff --git a/wcfsetup/install/files/lib/system/mail/DebugMailSender.class.php b/wcfsetup/install/files/lib/system/mail/DebugMailSender.class.php index b0ca59fa76..b4e18dfcd2 100644 --- a/wcfsetup/install/files/lib/system/mail/DebugMailSender.class.php +++ b/wcfsetup/install/files/lib/system/mail/DebugMailSender.class.php @@ -30,7 +30,7 @@ class DebugMailSender extends MailSender { $this->log = new File($logFilePath . 'mail.log', 'ab'); } - $this->log->write($this->printMail($mail)); + $this->log->write(self::printMail($mail)); } /** diff --git a/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php b/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php index b9d0c22ff8..2059a4c9e4 100644 --- a/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php +++ b/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php @@ -255,7 +255,7 @@ class TemplateScriptingCompiler { // throw error messages for unclosed tags if (count($this->tagStack) > 0) { foreach ($this->tagStack as $tagStack) { - throw new SystemException($this->formatSyntaxError('unclosed tag {'.$tagStack[0].'}', $this->currentIdentifier, $tagStack[1])); + throw new SystemException(static::formatSyntaxError('unclosed tag {'.$tagStack[0].'}', $this->currentIdentifier, $tagStack[1])); } return false; } @@ -335,7 +335,7 @@ class TemplateScriptingCompiler { case 'elseif': list($openTag) = end($this->tagStack); if ($openTag != 'if' && $openTag != 'elseif') { - throw new SystemException($this->formatSyntaxError('unxepected {elseif}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('unxepected {elseif}', $this->currentIdentifier, $this->currentLineNo)); } else if ($openTag == 'if') { $this->pushTag('elseif'); @@ -345,7 +345,7 @@ class TemplateScriptingCompiler { case 'else': list($openTag) = end($this->tagStack); if ($openTag != 'if' && $openTag != 'elseif') { - throw new SystemException($this->formatSyntaxError('unexpected {else}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('unexpected {else}', $this->currentIdentifier, $this->currentLineNo)); } $this->pushTag('else'); return ''; @@ -353,7 +353,7 @@ class TemplateScriptingCompiler { case '/if': list($openTag) = end($this->tagStack); if ($openTag != 'if' && $openTag != 'elseif' && $openTag != 'else') { - throw new SystemException($this->formatSyntaxError('unexpected {/if}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('unexpected {/if}', $this->currentIdentifier, $this->currentLineNo)); } $this->popTag('if'); return ''; @@ -368,7 +368,7 @@ class TemplateScriptingCompiler { case 'foreachelse': list($openTag) = end($this->tagStack); if ($openTag != 'foreach') { - throw new SystemException($this->formatSyntaxError('unexpected {foreachelse}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('unexpected {foreachelse}', $this->currentIdentifier, $this->currentLineNo)); } $this->pushTag('foreachelse'); return ''; @@ -376,7 +376,7 @@ class TemplateScriptingCompiler { case '/foreach': list($openTag) = end($this->tagStack); if ($openTag != 'foreach' && $openTag != 'foreachelse') { - throw new SystemException($this->formatSyntaxError('unexpected {/foreach}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('unexpected {/foreach}', $this->currentIdentifier, $this->currentLineNo)); } $this->popTag('foreach'); return ""; @@ -388,7 +388,7 @@ class TemplateScriptingCompiler { case 'sectionelse': list($openTag) = end($this->tagStack); if ($openTag != 'section') { - throw new SystemException($this->formatSyntaxError('unexpected {sectionelse}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('unexpected {sectionelse}', $this->currentIdentifier, $this->currentLineNo)); } $this->pushTag('sectionelse'); return ''; @@ -396,7 +396,7 @@ class TemplateScriptingCompiler { case '/section': list($openTag) = end($this->tagStack); if ($openTag != 'section' && $openTag != 'sectionelse') { - throw new SystemException($this->formatSyntaxError('unexpected {/section}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('unexpected {/section}', $this->currentIdentifier, $this->currentLineNo)); } $this->popTag('section'); return ""; @@ -408,7 +408,7 @@ class TemplateScriptingCompiler { case '/capture': list($openTag) = end($this->tagStack); if ($openTag != 'capture') { - throw new SystemException($this->formatSyntaxError('unexpected {/capture}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('unexpected {/capture}', $this->currentIdentifier, $this->currentLineNo)); } $this->popTag('capture'); return $this->compileCaptureTag(false); @@ -435,7 +435,7 @@ class TemplateScriptingCompiler { } } - throw new SystemException($this->formatSyntaxError('unknown tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('unknown tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo)); } /** @@ -453,7 +453,7 @@ class TemplateScriptingCompiler { } $this->autoloadPlugins[$className] = $className; - $tagArgs = $this->makeArgString($this->parseTagArgs($tagArgs, $tagCommand)); + $tagArgs = static::makeArgString($this->parseTagArgs($tagArgs, $tagCommand)); return "pluginObjects['".$className."']->execute(array(".$tagArgs."), \$this); ?>"; } @@ -487,7 +487,7 @@ class TemplateScriptingCompiler { if ($startTag) { $this->pushTag($tagCommand); - $tagArgs = $this->makeArgString($this->parseTagArgs($tagArgs, $tagCommand)); + $tagArgs = static::makeArgString($this->parseTagArgs($tagArgs, $tagCommand)); $phpCode = "tagStack[] = array('".$tagCommand."', array(".$tagArgs."));\n"; $phpCode .= "\$this->pluginObjects['".$className."']->init(\$this->tagStack[count(\$this->tagStack) - 1][1], \$this);\n"; @@ -496,7 +496,7 @@ class TemplateScriptingCompiler { else { list($openTag) = end($this->tagStack); if ($openTag != $tagCommand) { - throw new SystemException($this->formatSyntaxError('unexpected {/'.$tagCommand.'}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('unexpected {/'.$tagCommand.'}', $this->currentIdentifier, $this->currentLineNo)); } $this->popTag($tagCommand); $phpCode = "pluginObjects['".$className."']->execute(\$this->tagStack[count(\$this->tagStack) - 1][1], ob_get_clean(), \$this); }\n"; @@ -536,7 +536,7 @@ class TemplateScriptingCompiler { $this->compilerPlugins[$className] = new $className(); if (!($this->compilerPlugins[$className] instanceof ICompilerTemplatePlugin)) { - throw new SystemException($this->formatSyntaxError("Compiler plugin '".$tagCommand."' does not implement the interface 'ICompilerTemplatePlugin'", $this->currentIdentifier)); + throw new SystemException(static::formatSyntaxError("Compiler plugin '".$tagCommand."' does not implement the interface 'ICompilerTemplatePlugin'", $this->currentIdentifier)); } } @@ -603,10 +603,10 @@ class TemplateScriptingCompiler { // check arguments if (!isset($args['loop'])) { - throw new SystemException($this->formatSyntaxError("missing 'loop' attribute in section tag", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("missing 'loop' attribute in section tag", $this->currentIdentifier, $this->currentLineNo)); } if (!isset($args['name'])) { - throw new SystemException($this->formatSyntaxError("missing 'name' attribute in section tag", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("missing 'name' attribute in section tag", $this->currentIdentifier, $this->currentLineNo)); } if (!isset($args['show'])) { $args['show'] = true; @@ -678,10 +678,10 @@ class TemplateScriptingCompiler { // check arguments if (!isset($args['from'])) { - throw new SystemException($this->formatSyntaxError("missing 'from' attribute in foreach tag", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("missing 'from' attribute in foreach tag", $this->currentIdentifier, $this->currentLineNo)); } if (!isset($args['item'])) { - throw new SystemException($this->formatSyntaxError("missing 'item' attribute in foreach tag", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("missing 'item' attribute in foreach tag", $this->currentIdentifier, $this->currentLineNo)); } $foreachProp = ''; @@ -729,7 +729,7 @@ class TemplateScriptingCompiler { // check arguments if (!isset($args['file'])) { - throw new SystemException($this->formatSyntaxError("missing 'file' attribute in include tag", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("missing 'file' attribute in include tag", $this->currentIdentifier, $this->currentLineNo)); } // get filename @@ -824,7 +824,7 @@ class TemplateScriptingCompiler { } // make argument string - $argString = $this->makeArgString($args); + $argString = static::makeArgString($args); // build phpCode $phpCode = "formatSyntaxError('syntax error in tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('syntax error in tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo)); } // parse tag arguments @@ -961,7 +961,7 @@ class TemplateScriptingCompiler { $operator = (isset($operators[$i]) ? $operators[$i] : null); if ($operator !== '!' && $values[$i] == '') { - throw new SystemException($this->formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo)); } $leftParenthesis = mb_substr_count($values[$i], '('); @@ -972,7 +972,7 @@ class TemplateScriptingCompiler { $result .= str_repeat('(', $leftParenthesis - $rightParenthesis); if (str_replace('(', '', mb_substr($values[$i], 0, $leftParenthesis - $rightParenthesis)) != '') { - throw new SystemException($this->formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo)); } } else if ($leftParenthesis < $rightParenthesis) { @@ -980,7 +980,7 @@ class TemplateScriptingCompiler { $value = mb_substr($values[$i], 0, $leftParenthesis - $rightParenthesis); if ($leftParentheses < 0 || str_replace(')', '', mb_substr($values[$i], $leftParenthesis - $rightParenthesis)) != '') { - throw new SystemException($this->formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo)); } } else $value = $values[$i]; @@ -989,7 +989,7 @@ class TemplateScriptingCompiler { $result .= $this->compileVariableTag($value, false); } catch (SystemException $e) { - throw new SystemException($this->formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo), 0, nl2br($e, false)); + throw new SystemException(static::formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo), 0, nl2br($e, false)); } if ($leftParenthesis < $rightParenthesis) { @@ -1168,7 +1168,7 @@ class TemplateScriptingCompiler { case 'object access': if (/*strpos($values[$i], '$') !== false || */strpos($values[$i], '@@') !== false) { - throw new SystemException($this->formatSyntaxError("unexpected '->".$values[$i]."' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("unexpected '->".$values[$i]."' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); } if (strpos($values[$i], '$') !== false) $result .= '{'.$this->compileSimpleVariable($values[$i], $variableType).'}'; else $result .= $values[$i]; @@ -1216,7 +1216,7 @@ class TemplateScriptingCompiler { case 'modifier': if (strpos($values[$i], '$') !== false || strpos($values[$i], '@@') !== false) { - throw new SystemException($this->formatSyntaxError("unknown modifier '".$values[$i]."'", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("unknown modifier '".$values[$i]."'", $this->currentIdentifier, $this->currentLineNo)); } // handle modifier name @@ -1227,7 +1227,7 @@ class TemplateScriptingCompiler { $this->autoloadPlugins[$modifierData['className']] = $modifierData['className']; } else if ((!function_exists($modifierData['name']) && !in_array($modifierData['name'], $this->unknownPHPFunctions)) || in_array($modifierData['name'], $this->disabledPHPFunctions)) { - throw new SystemException($this->formatSyntaxError("unknown modifier '".$values[$i]."'", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("unknown modifier '".$values[$i]."'", $this->currentIdentifier, $this->currentLineNo)); } $statusStack[count($statusStack) - 1] = $status = 'modifier end'; @@ -1237,7 +1237,7 @@ class TemplateScriptingCompiler { case 'constant': case 'variable': case 'string': - throw new SystemException($this->formatSyntaxError('unknown tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError('unknown tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo)); break; } } @@ -1253,7 +1253,7 @@ class TemplateScriptingCompiler { break; } - throw new SystemException($this->formatSyntaxError("unexpected '.' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("unexpected '.' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); break; // object access @@ -1264,7 +1264,7 @@ class TemplateScriptingCompiler { break; } - throw new SystemException($this->formatSyntaxError("unexpected '->' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("unexpected '->' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); break; // left parenthesis @@ -1282,7 +1282,7 @@ class TemplateScriptingCompiler { break; } - throw new SystemException($this->formatSyntaxError("unexpected '(' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("unexpected '(' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); break; // right parenthesis @@ -1297,7 +1297,7 @@ class TemplateScriptingCompiler { } } - throw new SystemException($this->formatSyntaxError("unexpected ')' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("unexpected ')' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); break; // bracket open @@ -1309,7 +1309,7 @@ class TemplateScriptingCompiler { break; } - throw new SystemException($this->formatSyntaxError("unexpected '[' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("unexpected '[' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); break; // bracket close @@ -1324,7 +1324,7 @@ class TemplateScriptingCompiler { } } - throw new SystemException($this->formatSyntaxError("unexpected ']' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("unexpected ']' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); break; // modifier @@ -1338,7 +1338,7 @@ class TemplateScriptingCompiler { // clear status stack while ($oldStatus = array_pop($statusStack)) { if ($oldStatus != 'variable' && $oldStatus != 'object' && $oldStatus != 'constant' && $oldStatus != 'string' && $oldStatus != 'modifier end') { - throw new SystemException($this->formatSyntaxError("unexpected '|' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("unexpected '|' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); } } @@ -1361,7 +1361,7 @@ class TemplateScriptingCompiler { } } - throw new SystemException($this->formatSyntaxError("unexpected ':' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("unexpected ':' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); break; case ',': @@ -1377,7 +1377,7 @@ class TemplateScriptingCompiler { } } - throw new SystemException($this->formatSyntaxError("unexpected ',' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("unexpected ',' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); break; // math operators @@ -1393,7 +1393,7 @@ class TemplateScriptingCompiler { break; } - throw new SystemException($this->formatSyntaxError("unexpected '".$operator."' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); + throw new SystemException(static::formatSyntaxError("unexpected '".$operator."' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo)); break; } } @@ -1487,7 +1487,7 @@ class TemplateScriptingCompiler { if (!is_object($prefilter)) { $className = $this->template->getPluginClassName('prefilter', $prefilter); if (!class_exists($className)) { - throw new SystemException($this->formatSyntaxError('unable to find prefilter class '.$className, $this->currentIdentifier)); + throw new SystemException(static::formatSyntaxError('unable to find prefilter class '.$className, $this->currentIdentifier)); } $prefilter = new $className(); } @@ -1496,7 +1496,7 @@ class TemplateScriptingCompiler { $string = $prefilter->execute($templateName, $string, $this); } else { - throw new SystemException($this->formatSyntaxError("Prefilter '".(is_object($prefilter) ? get_class($prefilter) : $prefilter)."' does not implement the interface 'IPrefilterTemplatePlugin'", $this->currentIdentifier)); + throw new SystemException(static::formatSyntaxError("Prefilter '".(is_object($prefilter) ? get_class($prefilter) : $prefilter)."' does not implement the interface 'IPrefilterTemplatePlugin'", $this->currentIdentifier)); } } diff --git a/wcfsetup/install/files/lib/system/template/plugin/AppendCompilerTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/AppendCompilerTemplatePlugin.class.php index 1d1b7ef4e3..1a0843ddb5 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/AppendCompilerTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/AppendCompilerTemplatePlugin.class.php @@ -20,12 +20,12 @@ class AppendCompilerTemplatePlugin implements ICompilerTemplatePlugin { */ public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) { if (!isset($tagArgs['var'])) { - throw new SystemException($compiler->formatSyntaxError("missing 'var' argument in append tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); + throw new SystemException($compiler::formatSyntaxError("missing 'var' argument in append tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); } if (!isset($tagArgs['value'])) { - throw new SystemException($compiler->formatSyntaxError("missing 'value' argument in append tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); + throw new SystemException($compiler::formatSyntaxError("missing 'value' argument in append tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); } - + return "append(".$tagArgs['var'].", ".$tagArgs['value']."); ?>"; } @@ -33,6 +33,6 @@ class AppendCompilerTemplatePlugin implements ICompilerTemplatePlugin { * @inheritDoc */ public function executeEnd(TemplateScriptingCompiler $compiler) { - throw new SystemException($compiler->formatSyntaxError("unknown tag {/append}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); + throw new SystemException($compiler::formatSyntaxError("unknown tag {/append}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); } } diff --git a/wcfsetup/install/files/lib/system/template/plugin/AssignCompilerTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/AssignCompilerTemplatePlugin.class.php index b862f24966..65b02c8d84 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/AssignCompilerTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/AssignCompilerTemplatePlugin.class.php @@ -20,12 +20,12 @@ class AssignCompilerTemplatePlugin implements ICompilerTemplatePlugin { */ public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) { if (!isset($tagArgs['var'])) { - throw new SystemException($compiler->formatSyntaxError("missing 'var' argument in assign tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); + throw new SystemException($compiler::formatSyntaxError("missing 'var' argument in assign tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); } if (!isset($tagArgs['value'])) { - throw new SystemException($compiler->formatSyntaxError("missing 'value' argument in assign tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); + throw new SystemException($compiler::formatSyntaxError("missing 'value' argument in assign tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); } - + return "assign(".$tagArgs['var'].", ".$tagArgs['value']."); ?>"; } @@ -33,6 +33,6 @@ class AssignCompilerTemplatePlugin implements ICompilerTemplatePlugin { * @inheritDoc */ public function executeEnd(TemplateScriptingCompiler $compiler) { - throw new SystemException($compiler->formatSyntaxError("unknown tag {/assign}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); + throw new SystemException($compiler::formatSyntaxError("unknown tag {/assign}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); } } diff --git a/wcfsetup/install/files/lib/system/template/plugin/FetchCompilerTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/FetchCompilerTemplatePlugin.class.php index 98cb5244eb..8d78c86a14 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/FetchCompilerTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/FetchCompilerTemplatePlugin.class.php @@ -22,7 +22,7 @@ class FetchCompilerTemplatePlugin implements ICompilerTemplatePlugin { */ public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) { if (!isset($tagArgs['file'])) { - throw new SystemException($compiler->formatSyntaxError("missing 'file' argument in fetch tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); + throw new SystemException($compiler::formatSyntaxError("missing 'file' argument in fetch tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); } if (isset($tagArgs['assign'])) { @@ -37,6 +37,6 @@ class FetchCompilerTemplatePlugin implements ICompilerTemplatePlugin { * @inheritDoc */ public function executeEnd(TemplateScriptingCompiler $compiler) { - throw new SystemException($compiler->formatSyntaxError("unknown tag {/fetch}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); + throw new SystemException($compiler::formatSyntaxError("unknown tag {/fetch}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); } } diff --git a/wcfsetup/install/files/lib/system/template/plugin/ImplodeCompilerTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/ImplodeCompilerTemplatePlugin.class.php index 66ecc45c7b..dd452a3d24 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/ImplodeCompilerTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/ImplodeCompilerTemplatePlugin.class.php @@ -29,10 +29,10 @@ class ImplodeCompilerTemplatePlugin implements ICompilerTemplatePlugin { $compiler->pushTag('implode'); if (!isset($tagArgs['from'])) { - throw new SystemException($compiler->formatSyntaxError("missing 'from' argument in implode tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); + throw new SystemException($compiler::formatSyntaxError("missing 'from' argument in implode tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); } if (!isset($tagArgs['item'])) { - throw new SystemException($compiler->formatSyntaxError("missing 'item' argument in implode tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); + throw new SystemException($compiler::formatSyntaxError("missing 'item' argument in implode tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); } $hash = StringUtil::getRandomID(); diff --git a/wcfsetup/install/files/lib/system/template/plugin/LangCompilerTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/LangCompilerTemplatePlugin.class.php index ac744fd88c..4385c742da 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/LangCompilerTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/LangCompilerTemplatePlugin.class.php @@ -21,7 +21,7 @@ class LangCompilerTemplatePlugin implements ICompilerTemplatePlugin { public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) { $compiler->pushTag('lang'); - $tagArgs = $compiler->makeArgString($tagArgs); + $tagArgs = $compiler::makeArgString($tagArgs); return "tagStack[] = array('lang', array_merge(\$this->v, array($tagArgs))); ob_start(); diff --git a/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php index 868a5df0d1..2c3482efae 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php @@ -58,7 +58,7 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin { protected function makeLink($link, $pageNo, $activePage, $pages) { // first page if ($activePage != $pageNo) { - return '
  • '.StringUtil::formatInteger($pageNo).'
  • '."\n"; + return '
  • '.StringUtil::formatInteger($pageNo).'
  • '."\n"; } else { return '
  • '.StringUtil::formatInteger($pageNo).'
  • '."\n"; @@ -74,7 +74,7 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin { */ protected function makePreviousLink($link, $pageNo) { if ($pageNo > 1) { - return ''."\n"; + return ''."\n"; } else { return ''."\n"; @@ -91,7 +91,7 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin { */ protected function makeNextLink($link, $pageNo, $pages) { if ($pageNo && $pageNo < $pages) { - return ''."\n"; + return ''."\n"; } else { return ''."\n"; diff --git a/wcfsetup/install/files/lib/system/template/plugin/PrependCompilerTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/PrependCompilerTemplatePlugin.class.php index 33903ed4db..925415e7dc 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/PrependCompilerTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/PrependCompilerTemplatePlugin.class.php @@ -20,10 +20,10 @@ class PrependCompilerTemplatePlugin implements ICompilerTemplatePlugin { */ public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) { if (!isset($tagArgs['var'])) { - throw new SystemException($compiler->formatSyntaxError("missing 'var' argument in prepend tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); + throw new SystemException($compiler::formatSyntaxError("missing 'var' argument in prepend tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); } if (!isset($tagArgs['value'])) { - throw new SystemException($compiler->formatSyntaxError("missing 'value' argument in prepend tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); + throw new SystemException($compiler::formatSyntaxError("missing 'value' argument in prepend tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); } return "prepend(".$tagArgs['var'].", ".$tagArgs['value']."); ?>"; @@ -33,6 +33,6 @@ class PrependCompilerTemplatePlugin implements ICompilerTemplatePlugin { * @inheritDoc */ public function executeEnd(TemplateScriptingCompiler $compiler) { - throw new SystemException($compiler->formatSyntaxError("unknown tag {/prepend}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); + throw new SystemException($compiler::formatSyntaxError("unknown tag {/prepend}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); } } -- 2.20.1