aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template/twig/tokenparser
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/template/twig/tokenparser')
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/defineparser.php41
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/event.php31
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/includecss.php30
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/includejs.php31
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/includeparser.php32
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/includephp.php35
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/php.php31
7 files changed, 131 insertions, 100 deletions
diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php
index 8484f2e81a..b755836ccd 100644
--- a/phpBB/phpbb/template/twig/tokenparser/defineparser.php
+++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php
@@ -1,24 +1,30 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2013 phpBB Group, sections (c) 2009 Fabien Potencier
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
namespace phpbb\template\twig\tokenparser;
-
class defineparser extends \Twig_TokenParser
{
/**
- * Parses a token and returns a node.
- *
- * @param Twig_Token $token A Twig_Token instance
- *
- * @return Twig_NodeInterface A Twig_NodeInterface instance
- */
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ * @throws \Twig_Error_Syntax
+ * @throws \phpbb\template\twig\node\definenode
+ */
public function parse(\Twig_Token $token)
{
$lineno = $token->getLine();
@@ -26,7 +32,8 @@ class defineparser extends \Twig_TokenParser
$name = $this->parser->getExpressionParser()->parseExpression();
$capture = false;
- if ($stream->test(\Twig_Token::OPERATOR_TYPE, '=')) {
+ if ($stream->test(\Twig_Token::OPERATOR_TYPE, '='))
+ {
$stream->next();
$value = $this->parser->getExpressionParser()->parseExpression();
@@ -38,7 +45,9 @@ class defineparser extends \Twig_TokenParser
}
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
- } else {
+ }
+ else
+ {
$capture = true;
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
@@ -56,10 +65,10 @@ class defineparser extends \Twig_TokenParser
}
/**
- * Gets the tag name associated with this token parser.
- *
- * @return string The tag name
- */
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
public function getTag()
{
return 'DEFINE';
diff --git a/phpBB/phpbb/template/twig/tokenparser/event.php b/phpBB/phpbb/template/twig/tokenparser/event.php
index 8864e879f8..f73ef4ae25 100644
--- a/phpBB/phpbb/template/twig/tokenparser/event.php
+++ b/phpBB/phpbb/template/twig/tokenparser/event.php
@@ -1,24 +1,27 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
namespace phpbb\template\twig\tokenparser;
-
class event extends \Twig_TokenParser
{
/**
- * Parses a token and returns a node.
- *
- * @param Twig_Token $token A Twig_Token instance
- *
- * @return Twig_NodeInterface A Twig_NodeInterface instance
- */
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ */
public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
@@ -30,10 +33,10 @@ class event extends \Twig_TokenParser
}
/**
- * Gets the tag name associated with this token parser.
- *
- * @return string The tag name
- */
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
public function getTag()
{
return 'EVENT';
diff --git a/phpBB/phpbb/template/twig/tokenparser/includecss.php b/phpBB/phpbb/template/twig/tokenparser/includecss.php
index 7bf4c610b1..1f30811754 100644
--- a/phpBB/phpbb/template/twig/tokenparser/includecss.php
+++ b/phpBB/phpbb/template/twig/tokenparser/includecss.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -12,12 +16,12 @@ namespace phpbb\template\twig\tokenparser;
class includecss extends \Twig_TokenParser
{
/**
- * Parses a token and returns a node.
- *
- * @param Twig_Token $token A Twig_Token instance
- *
- * @return Twig_NodeInterface A Twig_NodeInterface instance
- */
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ */
public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
@@ -29,10 +33,10 @@ class includecss extends \Twig_TokenParser
}
/**
- * Gets the tag name associated with this token parser.
- *
- * @return string The tag name
- */
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
public function getTag()
{
return 'INCLUDECSS';
diff --git a/phpBB/phpbb/template/twig/tokenparser/includejs.php b/phpBB/phpbb/template/twig/tokenparser/includejs.php
index 0e46915b86..4b67d2c468 100644
--- a/phpBB/phpbb/template/twig/tokenparser/includejs.php
+++ b/phpBB/phpbb/template/twig/tokenparser/includejs.php
@@ -1,24 +1,27 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
namespace phpbb\template\twig\tokenparser;
-
class includejs extends \Twig_TokenParser
{
/**
- * Parses a token and returns a node.
- *
- * @param Twig_Token $token A Twig_Token instance
- *
- * @return Twig_NodeInterface A Twig_NodeInterface instance
- */
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ */
public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
@@ -30,10 +33,10 @@ class includejs extends \Twig_TokenParser
}
/**
- * Gets the tag name associated with this token parser.
- *
- * @return string The tag name
- */
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
public function getTag()
{
return 'INCLUDEJS';
diff --git a/phpBB/phpbb/template/twig/tokenparser/includeparser.php b/phpBB/phpbb/template/twig/tokenparser/includeparser.php
index d351f1b4cd..aa7236aaa6 100644
--- a/phpBB/phpbb/template/twig/tokenparser/includeparser.php
+++ b/phpBB/phpbb/template/twig/tokenparser/includeparser.php
@@ -1,24 +1,28 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2013 phpBB Group, sections (c) 2009 Fabien Potencier
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
namespace phpbb\template\twig\tokenparser;
-
class includeparser extends \Twig_TokenParser_Include
{
/**
- * Parses a token and returns a node.
- *
- * @param Twig_Token $token A Twig_Token instance
- *
- * @return Twig_NodeInterface A Twig_NodeInterface instance
- */
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ */
public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
@@ -29,10 +33,10 @@ class includeparser extends \Twig_TokenParser_Include
}
/**
- * Gets the tag name associated with this token parser.
- *
- * @return string The tag name
- */
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
public function getTag()
{
return 'INCLUDE';
diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php
index 1b3d1742e3..3992636f8c 100644
--- a/phpBB/phpbb/template/twig/tokenparser/includephp.php
+++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php
@@ -1,24 +1,28 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2013 phpBB Group, sections (c) 2009 Fabien Potencier, Armin Ronacher
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
namespace phpbb\template\twig\tokenparser;
-
class includephp extends \Twig_TokenParser
{
/**
- * Parses a token and returns a node.
- *
- * @param Twig_Token $token A Twig_Token instance
- *
- * @return Twig_NodeInterface A Twig_NodeInterface instance
- */
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ */
public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
@@ -26,7 +30,8 @@ class includephp extends \Twig_TokenParser
$stream = $this->parser->getStream();
$ignoreMissing = false;
- if ($stream->test(\Twig_Token::NAME_TYPE, 'ignore')) {
+ if ($stream->test(\Twig_Token::NAME_TYPE, 'ignore'))
+ {
$stream->next();
$stream->expect(\Twig_Token::NAME_TYPE, 'missing');
@@ -39,10 +44,10 @@ class includephp extends \Twig_TokenParser
}
/**
- * Gets the tag name associated with this token parser.
- *
- * @return string The tag name
- */
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
public function getTag()
{
return 'INCLUDEPHP';
diff --git a/phpBB/phpbb/template/twig/tokenparser/php.php b/phpBB/phpbb/template/twig/tokenparser/php.php
index b427969e2d..f11ce35896 100644
--- a/phpBB/phpbb/template/twig/tokenparser/php.php
+++ b/phpBB/phpbb/template/twig/tokenparser/php.php
@@ -1,24 +1,27 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
namespace phpbb\template\twig\tokenparser;
-
class php extends \Twig_TokenParser
{
/**
- * Parses a token and returns a node.
- *
- * @param Twig_Token $token A Twig_Token instance
- *
- * @return Twig_NodeInterface A Twig_NodeInterface instance
- */
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ */
public function parse(\Twig_Token $token)
{
$stream = $this->parser->getStream();
@@ -38,10 +41,10 @@ class php extends \Twig_TokenParser
}
/**
- * Gets the tag name associated with this token parser.
- *
- * @return string The tag name
- */
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
public function getTag()
{
return 'PHP';