diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php index bbf1142939..27426606aa 100644 --- a/phpBB/phpbb/template/twig/environment.php +++ b/phpBB/phpbb/template/twig/environment.php @@ -261,8 +261,8 @@ class environment extends \Twig\Environment * * @param string $name The template name * @param integer $index The index if it is an embedded template - * @return \Twig_TemplateInterface A template instance representing the given template name - * @throws \Twig_Error_Loader + * @return \Twig\Template A template instance representing the given template name + * @throws \Twig\Error\LoaderError */ public function loadTemplate($name, $index = null) { @@ -279,7 +279,7 @@ class environment extends \Twig\Environment return parent::loadTemplate('@' . $namespace . '/' . $name, $index); } - catch (\Twig_Error_Loader $e) + catch (\Twig\Error\LoaderError $e) { } } @@ -298,7 +298,7 @@ class environment extends \Twig\Environment * * @param string $name The template name * @return string - * @throws \Twig_Error_Loader + * @throws \Twig\Error\LoaderError */ public function findTemplate($name) { @@ -315,7 +315,7 @@ class environment extends \Twig\Environment return parent::getLoader()->getCacheKey('@' . $namespace . '/' . $name); } - catch (\Twig_Error_Loader $e) + catch (\Twig\Error\LoaderError $e) { } } diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php index 5e2d2a8147..3dc5e548e5 100644 --- a/phpBB/phpbb/template/twig/extension.php +++ b/phpBB/phpbb/template/twig/extension.php @@ -13,7 +13,7 @@ namespace phpbb\template\twig; -class extension extends \Twig_Extension +class extension extends \Twig\Extension\AbstractExtension { /** @var \phpbb\template\context */ protected $context; @@ -51,7 +51,7 @@ class extension extends \Twig_Extension /** * Returns the token parser instance to add to the existing list. * - * @return array An array of Twig_TokenParser instances + * @return array An array of \Twig\TokenParser\AbstractTokenParser instances */ public function getTokenParsers() { @@ -74,9 +74,9 @@ class extension extends \Twig_Extension public function getFilters() { return array( - new \Twig_SimpleFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)), + new \Twig\TwigFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)), // @deprecated 3.2.0 Uses twig's JS escape method instead of addslashes - new \Twig_SimpleFilter('addslashes', 'addslashes'), + new \Twig\TwigFilter('addslashes', 'addslashes'), ); } @@ -88,9 +88,9 @@ class extension extends \Twig_Extension public function getFunctions() { return array( - new \Twig_SimpleFunction('lang', array($this, 'lang')), - new \Twig_SimpleFunction('lang_defined', array($this, 'lang_defined')), - new \Twig_SimpleFunction('get_class', 'get_class'), + new \Twig\TwigFunction('lang', array($this, 'lang')), + new \Twig\TwigFunction('lang_defined', array($this, 'lang_defined')), + new \Twig\TwigFunction('get_class', 'get_class'), ); } @@ -103,30 +103,30 @@ class extension extends \Twig_Extension { return array( array( - '!' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'), + '!' => array('precedence' => 50, 'class' => '\Twig\Node\Expression\Unary\NotUnary'), ), array( // precedence settings are copied from similar operators in Twig core extension - '||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), - '&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + '||' => array('precedence' => 10, 'class' => '\Twig\Node\Expression\Binary\OrBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), + '&&' => array('precedence' => 15, 'class' => '\Twig\Node\Expression\Binary\AndBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), - 'eq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + 'eq' => array('precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\EqualBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), - 'ne' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), - 'neq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), - '<>' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + 'ne' => array('precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\NotEqualBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), + 'neq' => array('precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\NotEqualBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), + '<>' => array('precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\NotEqualBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), - '===' => array('precedence' => 20, 'class' => '\phpbb\template\twig\node\expression\binary\equalequal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), - '!==' => array('precedence' => 20, 'class' => '\phpbb\template\twig\node\expression\binary\notequalequal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + '===' => array('precedence' => 20, 'class' => '\phpbb\template\twig\node\expression\binary\equalequal', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), + '!==' => array('precedence' => 20, 'class' => '\phpbb\template\twig\node\expression\binary\notequalequal', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), - 'gt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Greater', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), - 'gte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), - 'ge' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), - 'lt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), - 'lte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), - 'le' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + 'gt' => array('precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\GreaterBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), + 'gte' => array('precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\GreaterEqualBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), + 'ge' => array('precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\GreaterEqualBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), + 'lt' => array('precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\LessBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), + 'lte' => array('precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\LessEqualBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), + 'le' => array('precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\LessEqualBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), - 'mod' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), + 'mod' => array('precedence' => 60, 'class' => '\Twig\Node\Expression\Binary\ModBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT), ), ); } diff --git a/phpBB/phpbb/template/twig/extension/avatar.php b/phpBB/phpbb/template/twig/extension/avatar.php index 7a17fd4b42..c699fcf5b3 100644 --- a/phpBB/phpbb/template/twig/extension/avatar.php +++ b/phpBB/phpbb/template/twig/extension/avatar.php @@ -33,7 +33,7 @@ class avatar extends \Twig_Extension public function getFunctions() { return array( - new \Twig_SimpleFunction('avatar', array($this, 'get_avatar')), + new \Twig\TwigFunction('avatar', array($this, 'get_avatar')), ); } diff --git a/phpBB/phpbb/template/twig/extension/config.php b/phpBB/phpbb/template/twig/extension/config.php index cbf6e505c5..a752890fe6 100644 --- a/phpBB/phpbb/template/twig/extension/config.php +++ b/phpBB/phpbb/template/twig/extension/config.php @@ -46,7 +46,7 @@ class config extends \Twig_Extension public function getFunctions() { return array( - new \Twig_SimpleFunction('config', array($this, 'get_config')), + new \Twig\TwigFunction('config', array($this, 'get_config')), ); } diff --git a/phpBB/phpbb/template/twig/extension/username.php b/phpBB/phpbb/template/twig/extension/username.php index ef149693a0..f419c6ff0f 100644 --- a/phpBB/phpbb/template/twig/extension/username.php +++ b/phpBB/phpbb/template/twig/extension/username.php @@ -33,7 +33,7 @@ class username extends \Twig_Extension public function getFunctions() { return array( - new \Twig_SimpleFunction('username', array($this, 'get_username')), + new \Twig\TwigFunction('username', array($this, 'get_username')), ); } diff --git a/phpBB/phpbb/template/twig/loader.php b/phpBB/phpbb/template/twig/loader.php index d4001082ac..ccc64d0ddc 100644 --- a/phpBB/phpbb/template/twig/loader.php +++ b/phpBB/phpbb/template/twig/loader.php @@ -139,7 +139,7 @@ class loader extends \Twig\Loader\FilesystemLoader // Try validating the name (which may throw an exception) $this->validateName($name); } - catch (\Twig_Error_Loader $e) + catch (\Twig\Error\LoaderError $e) { if (strpos($e->getRawMessage(), 'Looks like you try to load a template outside configured directories') === 0) { diff --git a/phpBB/phpbb/template/twig/node/definenode.php b/phpBB/phpbb/template/twig/node/definenode.php index fb5053ac18..4f963e6680 100644 --- a/phpBB/phpbb/template/twig/node/definenode.php +++ b/phpBB/phpbb/template/twig/node/definenode.php @@ -24,7 +24,7 @@ class definenode extends \Twig\Node\Node /** * Compiles the node to PHP. * - * @param \Twig\Compiler A Twig_Compiler instance + * @param \Twig\Compiler A Twig\Compiler instance */ public function compile(\Twig\Compiler $compiler) { @@ -37,7 +37,7 @@ class definenode extends \Twig\Node\Node ->subcompile($this->getNode('value')) ; - $compiler->write("\$value = ('' === \$value = ob_get_clean()) ? '' : new \Twig_Markup(\$value, \$this->env->getCharset());\n"); + $compiler->write("\$value = ('' === \$value = ob_get_clean()) ? '' : new \Twig\Markup(\$value, \$this->env->getCharset());\n"); } else { diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php index 97116077af..9766750500 100644 --- a/phpBB/phpbb/template/twig/node/event.php +++ b/phpBB/phpbb/template/twig/node/event.php @@ -34,7 +34,7 @@ class event extends \Twig\Node\Node /** * Compiles the node to PHP. * - * @param \Twig\Compiler A Twig_Compiler instance + * @param \Twig\Compiler A Twig\Compiler instance */ public function compile(\Twig\Compiler $compiler) { diff --git a/phpBB/phpbb/template/twig/node/includeasset.php b/phpBB/phpbb/template/twig/node/includeasset.php index cf9beeac9b..8deca24e76 100644 --- a/phpBB/phpbb/template/twig/node/includeasset.php +++ b/phpBB/phpbb/template/twig/node/includeasset.php @@ -23,7 +23,7 @@ abstract class includeasset extends \Twig\Node\Node /** * Compiles the node to PHP. * - * @param \Twig\Compiler A Twig_Compiler instance + * @param \Twig\Compiler A Twig\Compiler instance */ public function compile(\Twig\Compiler $compiler) { diff --git a/phpBB/phpbb/template/twig/node/includenode.php b/phpBB/phpbb/template/twig/node/includenode.php index 2887d1a725..1786b3a430 100644 --- a/phpBB/phpbb/template/twig/node/includenode.php +++ b/phpBB/phpbb/template/twig/node/includenode.php @@ -18,7 +18,7 @@ class includenode extends \Twig\Node\IncludeNode /** * Compiles the node to PHP. * - * @param \Twig\Compiler A Twig_Compiler instance + * @param \Twig\Compiler A Twig\Compiler instance */ public function compile(\Twig\Compiler $compiler) { diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php index 83625f3c63..045b1a5428 100644 --- a/phpBB/phpbb/template/twig/node/includephp.php +++ b/phpBB/phpbb/template/twig/node/includephp.php @@ -29,7 +29,7 @@ class includephp extends \Twig\Node\Node /** * Compiles the node to PHP. * - * @param \Twig\Compiler A Twig_Compiler instance + * @param \Twig\Compiler A Twig\Compiler instance */ public function compile(\Twig\Compiler $compiler) { @@ -80,7 +80,7 @@ class includephp extends \Twig\Node\Node { $compiler ->outdent() - ->write("} catch (\Twig_Error_Loader \$e) {\n") + ->write("} catch (\Twig\Error\LoaderError \$e) {\n") ->indent() ->write("// ignore missing template\n") ->outdent() diff --git a/phpBB/phpbb/template/twig/node/php.php b/phpBB/phpbb/template/twig/node/php.php index 2823b11150..fed14d1022 100644 --- a/phpBB/phpbb/template/twig/node/php.php +++ b/phpBB/phpbb/template/twig/node/php.php @@ -28,7 +28,7 @@ class php extends \Twig\Node\Node /** * Compiles the node to PHP. * - * @param \Twig\Compiler A Twig_Compiler instance + * @param \Twig\Compiler A Twig\Compiler instance */ public function compile(\Twig\Compiler $compiler) { diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php index 08696b4ca4..3cb7873652 100644 --- a/phpBB/phpbb/template/twig/tokenparser/defineparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php @@ -19,10 +19,10 @@ class defineparser extends \Twig\TokenParser\AbstractTokenParser /** * Parses a token and returns a node. * - * @param \Twig\Token $token A Twig_Token instance + * @param \Twig\Token $token A Twig\Token instance * - * @return \Twig\Node\Node A Twig_Node instance - * @throws \Twig_Error_Syntax + * @return \Twig\Node\Node A Twig\Node instance + * @throws \Twig\Error\SyntaxError * @throws \phpbb\template\twig\node\definenode */ public function parse(\Twig\Token $token) @@ -41,7 +41,7 @@ class defineparser extends \Twig\TokenParser\AbstractTokenParser { // This would happen if someone improperly formed their DEFINE syntax // e.g. - throw new \Twig_Error_Syntax('Invalid DEFINE', $token->getLine(), $this->parser->getStream()->getSourceContext()->getPath()); + throw new \Twig\Error\SyntaxError('Invalid DEFINE', $token->getLine(), $this->parser->getStream()->getSourceContext()->getPath()); } $stream->expect(\Twig\Token::BLOCK_END_TYPE); diff --git a/phpBB/phpbb/template/twig/tokenparser/event.php b/phpBB/phpbb/template/twig/tokenparser/event.php index 5aae2721c8..7b9742cc95 100644 --- a/phpBB/phpbb/template/twig/tokenparser/event.php +++ b/phpBB/phpbb/template/twig/tokenparser/event.php @@ -31,9 +31,9 @@ class event extends \Twig\TokenParser\AbstractTokenParser /** * Parses a token and returns a node. * - * @param \Twig\Token $token A Twig_Token instance + * @param \Twig\Token $token A Twig\Token instance * - * @return \Twig\Node\Node A Twig_Node instance + * @return \Twig\Node\Node A Twig\Node instance */ public function parse(\Twig\Token $token) { diff --git a/phpBB/phpbb/template/twig/tokenparser/includecss.php b/phpBB/phpbb/template/twig/tokenparser/includecss.php index 72e2bc96dd..606adb4d29 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includecss.php +++ b/phpBB/phpbb/template/twig/tokenparser/includecss.php @@ -18,9 +18,9 @@ class includecss extends \Twig\TokenParser\AbstractTokenParser /** * Parses a token and returns a node. * - * @param \Twig\Token $token A Twig_Token instance + * @param \Twig\Token $token A Twig\Token instance * - * @return \Twig\Node\Node A Twig_Node instance + * @return \Twig\Node\Node A Twig\Node instance */ public function parse(\Twig\Token $token) { diff --git a/phpBB/phpbb/template/twig/tokenparser/includejs.php b/phpBB/phpbb/template/twig/tokenparser/includejs.php index 4f5b67696e..6b7a4e26b5 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includejs.php +++ b/phpBB/phpbb/template/twig/tokenparser/includejs.php @@ -18,9 +18,9 @@ class includejs extends \Twig\TokenParser\AbstractTokenParser /** * Parses a token and returns a node. * - * @param \Twig\Token $token A Twig_Token instance + * @param \Twig\Token $token A Twig\Token instance * - * @return \Twig\Node\Node A Twig_Node instance + * @return \Twig\Node\Node A Twig\Node instance */ public function parse(\Twig\Token $token) { diff --git a/phpBB/phpbb/template/twig/tokenparser/includeparser.php b/phpBB/phpbb/template/twig/tokenparser/includeparser.php index 5ff2582e35..62148489fa 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includeparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/includeparser.php @@ -19,9 +19,9 @@ class includeparser extends \Twig\TokenParser\IncludeTokenParser /** * Parses a token and returns a node. * - * @param \Twig\Token $token A Twig_Token instance + * @param \Twig\Token $token A Twig\Token instance * - * @return \Twig\Node\Node A Twig_Node instance + * @return \Twig\Node\Node A Twig\Node instance */ public function parse(\Twig\Token $token) { diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php index 02b565c297..a6f8f92139 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includephp.php +++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php @@ -32,9 +32,9 @@ class includephp extends \Twig\TokenParser\AbstractTokenParser /** * Parses a token and returns a node. * - * @param \Twig\Token $token A Twig_Token instance + * @param \Twig\Token $token A Twig\Token instance * - * @return \Twig\Node\Node A Twig_Node instance + * @return \Twig\Node\Node A Twig\Node instance */ public function parse(\Twig\Token $token) { diff --git a/phpBB/phpbb/template/twig/tokenparser/php.php b/phpBB/phpbb/template/twig/tokenparser/php.php index 38ecba77ca..1eab7b794a 100644 --- a/phpBB/phpbb/template/twig/tokenparser/php.php +++ b/phpBB/phpbb/template/twig/tokenparser/php.php @@ -31,9 +31,9 @@ class php extends \Twig\TokenParser\AbstractTokenParser /** * Parses a token and returns a node. * - * @param \Twig\Token $token A Twig_Token instance + * @param \Twig\Token $token A Twig\Token instance * - * @return \Twig\Node\Node A Twig_Node instance + * @return \Twig\Node\Node A Twig\Node instance */ public function parse(\Twig\Token $token) {