mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-13 04:04:12 +02:00
[ticket/11700] Move all recent code to namespaces
PHPBB3-11700
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\template\twig\tokenparser;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
|
||||
class phpbb_template_twig_tokenparser_defineparser extends Twig_TokenParser
|
||||
class defineparser extends \Twig_TokenParser
|
||||
{
|
||||
/**
|
||||
* Parses a token and returns a node.
|
||||
@@ -25,31 +27,31 @@ class phpbb_template_twig_tokenparser_defineparser extends Twig_TokenParser
|
||||
*
|
||||
* @return Twig_NodeInterface A Twig_NodeInterface instance
|
||||
*/
|
||||
public function parse(Twig_Token $token)
|
||||
public function parse(\Twig_Token $token)
|
||||
{
|
||||
$lineno = $token->getLine();
|
||||
$stream = $this->parser->getStream();
|
||||
$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();
|
||||
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
|
||||
} else {
|
||||
$capture = true;
|
||||
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
|
||||
|
||||
$value = $this->parser->subparse(array($this, 'decideBlockEnd'), true);
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
|
||||
}
|
||||
|
||||
return new phpbb_template_twig_node_definenode($capture, $name, $value, $lineno, $this->getTag());
|
||||
return new \phpbb\template\twig\node\definenode($capture, $name, $value, $lineno, $this->getTag());
|
||||
}
|
||||
|
||||
public function decideBlockEnd(Twig_Token $token)
|
||||
public function decideBlockEnd(\Twig_Token $token)
|
||||
{
|
||||
return $token->test('ENDDEFINE');
|
||||
}
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\template\twig\tokenparser;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
|
||||
class phpbb_template_twig_tokenparser_event extends Twig_TokenParser
|
||||
class event extends \Twig_TokenParser
|
||||
{
|
||||
/**
|
||||
* Parses a token and returns a node.
|
||||
@@ -25,14 +27,14 @@ class phpbb_template_twig_tokenparser_event extends Twig_TokenParser
|
||||
*
|
||||
* @return Twig_NodeInterface A Twig_NodeInterface instance
|
||||
*/
|
||||
public function parse(Twig_Token $token)
|
||||
public function parse(\Twig_Token $token)
|
||||
{
|
||||
$expr = $this->parser->getExpressionParser()->parseExpression();
|
||||
|
||||
$stream = $this->parser->getStream();
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
|
||||
|
||||
return new phpbb_template_twig_node_event($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
|
||||
return new \phpbb\template\twig\node\event($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -7,7 +7,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
class phpbb_template_twig_tokenparser_includecss extends Twig_TokenParser
|
||||
namespace phpbb\template\twig\tokenparser;
|
||||
|
||||
class includecss extends \Twig_TokenParser
|
||||
{
|
||||
/**
|
||||
* Parses a token and returns a node.
|
||||
@@ -16,14 +18,14 @@ class phpbb_template_twig_tokenparser_includecss extends Twig_TokenParser
|
||||
*
|
||||
* @return Twig_NodeInterface A Twig_NodeInterface instance
|
||||
*/
|
||||
public function parse(Twig_Token $token)
|
||||
public function parse(\Twig_Token $token)
|
||||
{
|
||||
$expr = $this->parser->getExpressionParser()->parseExpression();
|
||||
|
||||
$stream = $this->parser->getStream();
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
|
||||
|
||||
return new phpbb_template_twig_node_includecss($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
|
||||
return new \phpbb\template\twig\node\includecss($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\template\twig\tokenparser;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
|
||||
class phpbb_template_twig_tokenparser_includejs extends Twig_TokenParser
|
||||
class includejs extends \Twig_TokenParser
|
||||
{
|
||||
/**
|
||||
* Parses a token and returns a node.
|
||||
@@ -25,14 +27,14 @@ class phpbb_template_twig_tokenparser_includejs extends Twig_TokenParser
|
||||
*
|
||||
* @return Twig_NodeInterface A Twig_NodeInterface instance
|
||||
*/
|
||||
public function parse(Twig_Token $token)
|
||||
public function parse(\Twig_Token $token)
|
||||
{
|
||||
$expr = $this->parser->getExpressionParser()->parseExpression();
|
||||
|
||||
$stream = $this->parser->getStream();
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
|
||||
|
||||
return new phpbb_template_twig_node_includejs($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
|
||||
return new \phpbb\template\twig\node\includejs($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\template\twig\tokenparser;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
|
||||
class phpbb_template_twig_tokenparser_includeparser extends Twig_TokenParser_Include
|
||||
class includeparser extends \Twig_TokenParser_Include
|
||||
{
|
||||
/**
|
||||
* Parses a token and returns a node.
|
||||
@@ -25,13 +27,13 @@ class phpbb_template_twig_tokenparser_includeparser extends Twig_TokenParser_Inc
|
||||
*
|
||||
* @return Twig_NodeInterface A Twig_NodeInterface instance
|
||||
*/
|
||||
public function parse(Twig_Token $token)
|
||||
public function parse(\Twig_Token $token)
|
||||
{
|
||||
$expr = $this->parser->getExpressionParser()->parseExpression();
|
||||
|
||||
list($variables, $only, $ignoreMissing) = $this->parseArguments();
|
||||
|
||||
return new phpbb_template_twig_node_includenode($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag());
|
||||
return new \phpbb\template\twig\node\includenode($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\template\twig\tokenparser;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
|
||||
class phpbb_template_twig_tokenparser_includephp extends Twig_TokenParser
|
||||
class includephp extends \Twig_TokenParser
|
||||
{
|
||||
/**
|
||||
* Parses a token and returns a node.
|
||||
@@ -25,23 +27,23 @@ class phpbb_template_twig_tokenparser_includephp extends Twig_TokenParser
|
||||
*
|
||||
* @return Twig_NodeInterface A Twig_NodeInterface instance
|
||||
*/
|
||||
public function parse(Twig_Token $token)
|
||||
public function parse(\Twig_Token $token)
|
||||
{
|
||||
$expr = $this->parser->getExpressionParser()->parseExpression();
|
||||
|
||||
$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');
|
||||
$stream->expect(\Twig_Token::NAME_TYPE, 'missing');
|
||||
|
||||
$ignoreMissing = true;
|
||||
}
|
||||
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
|
||||
|
||||
return new phpbb_template_twig_node_includephp($expr, $this->parser->getEnvironment(), $ignoreMissing, $token->getLine(), $this->getTag());
|
||||
return new \phpbb\template\twig\node\includephp($expr, $this->parser->getEnvironment(), $ignoreMissing, $token->getLine(), $this->getTag());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\template\twig\tokenparser;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
|
||||
class phpbb_template_twig_tokenparser_php extends Twig_TokenParser
|
||||
class php extends \Twig_TokenParser
|
||||
{
|
||||
/**
|
||||
* Parses a token and returns a node.
|
||||
@@ -25,20 +27,20 @@ class phpbb_template_twig_tokenparser_php extends Twig_TokenParser
|
||||
*
|
||||
* @return Twig_NodeInterface A Twig_NodeInterface instance
|
||||
*/
|
||||
public function parse(Twig_Token $token)
|
||||
public function parse(\Twig_Token $token)
|
||||
{
|
||||
$stream = $this->parser->getStream();
|
||||
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
|
||||
|
||||
$body = $this->parser->subparse(array($this, 'decideEnd'), true);
|
||||
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
|
||||
|
||||
return new phpbb_template_twig_node_php($body, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
|
||||
return new \phpbb\template\twig\node\php($body, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
|
||||
}
|
||||
|
||||
public function decideEnd(Twig_Token $token)
|
||||
public function decideEnd(\Twig_Token $token)
|
||||
{
|
||||
return $token->test('ENDPHP');
|
||||
}
|
||||
|
Reference in New Issue
Block a user