Update PSR-2

This commit is contained in:
Sławomir Kaleta
2018-06-12 09:58:15 +02:00
parent cc4d8fa1a0
commit 2404095783
190 changed files with 3833 additions and 3119 deletions
@@ -76,8 +76,8 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom
/**
* method to compile a Smarty template
*
* @param mixed $_content template source
* @param bool $isTemplateSource
* @param mixed $_content template source
* @param bool $isTemplateSource
*
* @return bool true if compiling succeeded, false if it failed
* @throws \SmartyCompilerException
@@ -89,9 +89,15 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom
then written to compiled files. */
// init the lexer/parser to compile the template
$this->parser =
new $this->parser_class(new $this->lexer_class(str_replace(array("\r\n",
"\r"), "\n", $_content), $this),
$this);
new $this->parser_class(
new $this->lexer_class(
str_replace(
array("\r\n",
"\r"), "\n", $_content
), $this
),
$this
);
if ($isTemplateSource && $this->template->caching) {
$this->parser->insertPhpCode("<?php\n\$_smarty_tpl->compiled->nocache_hash = '{$this->nocache_hash}';\n?>\n");
}
@@ -127,8 +133,10 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom
if (count($this->_tag_stack) > 0) {
// get stacked info
list($openTag, $_data) = array_pop($this->_tag_stack);
$this->trigger_template_error("unclosed {$this->smarty->left_delimiter}" . $openTag .
"{$this->smarty->right_delimiter} tag");
$this->trigger_template_error(
"unclosed {$this->smarty->left_delimiter}" . $openTag .
"{$this->smarty->right_delimiter} tag"
);
}
// call post compile callbacks
foreach ($this->postCompileCallbacks as $cb) {
@@ -148,7 +156,6 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom
* @param array $parameter optional parameter array
* @param string $key optional key for callback
* @param bool $replace if true replace existing keyed callback
*
*/
public function registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false)
{