mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-20 07:21:30 +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\node;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -16,9 +18,9 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
|
||||
class phpbb_template_twig_node_definenode extends Twig_Node
|
||||
class definenode extends \Twig_Node
|
||||
{
|
||||
public function __construct($capture, Twig_NodeInterface $name, Twig_NodeInterface $value, $lineno, $tag = null)
|
||||
public function __construct($capture, \Twig_NodeInterface $name, \Twig_NodeInterface $value, $lineno, $tag = null)
|
||||
{
|
||||
parent::__construct(array('name' => $name, 'value' => $value), array('capture' => $capture, 'safe' => false), $lineno, $tag);
|
||||
}
|
||||
@@ -28,7 +30,7 @@ class phpbb_template_twig_node_definenode extends Twig_Node
|
||||
*
|
||||
* @param Twig_Compiler A Twig_Compiler instance
|
||||
*/
|
||||
public function compile(Twig_Compiler $compiler)
|
||||
public function compile(\Twig_Compiler $compiler)
|
||||
{
|
||||
$compiler->addDebugInfo($this);
|
||||
|
||||
@@ -38,7 +40,7 @@ class phpbb_template_twig_node_definenode extends Twig_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
|
||||
{
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\template\twig\node;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -16,12 +18,12 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
|
||||
class phpbb_template_twig_node_event extends Twig_Node
|
||||
class event extends \Twig_Node
|
||||
{
|
||||
/** @var Twig_Environment */
|
||||
protected $environment;
|
||||
|
||||
public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $lineno, $tag = null)
|
||||
public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
|
||||
{
|
||||
$this->environment = $environment;
|
||||
|
||||
@@ -33,7 +35,7 @@ class phpbb_template_twig_node_event extends Twig_Node
|
||||
*
|
||||
* @param Twig_Compiler A Twig_Compiler instance
|
||||
*/
|
||||
public function compile(Twig_Compiler $compiler)
|
||||
public function compile(\Twig_Compiler $compiler)
|
||||
{
|
||||
$compiler->addDebugInfo($this);
|
||||
|
||||
@@ -48,7 +50,7 @@ class phpbb_template_twig_node_event extends Twig_Node
|
||||
// If debug mode is enabled, lets check for new/removed EVENT
|
||||
// templates on page load rather than at compile. This is
|
||||
// slower, but makes developing extensions easier (no need to
|
||||
// purge the cache when a new event template file is added)
|
||||
// purge the cache when a new \event template file is added)
|
||||
$compiler
|
||||
->write("if (\$this->env->getLoader()->exists('@{$ext_namespace}/{$location}.html')) {\n")
|
||||
->indent()
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\template\twig\node\expression\binary;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -16,9 +18,9 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
|
||||
class phpbb_template_twig_node_expression_binary_equalequal extends Twig_Node_Expression_Binary
|
||||
class equalequal extends \Twig_Node_Expression_Binary
|
||||
{
|
||||
public function operator(Twig_Compiler $compiler)
|
||||
public function operator(\Twig_Compiler $compiler)
|
||||
{
|
||||
return $compiler->raw('===');
|
||||
}
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\template\twig\node\expression\binary;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -16,9 +18,9 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
|
||||
class phpbb_template_twig_node_expression_binary_notequalequal extends Twig_Node_Expression_Binary
|
||||
class notequalequal extends \Twig_Node_Expression_Binary
|
||||
{
|
||||
public function operator(Twig_Compiler $compiler)
|
||||
public function operator(\Twig_Compiler $compiler)
|
||||
{
|
||||
return $compiler->raw('!==');
|
||||
}
|
||||
|
@@ -7,12 +7,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
class phpbb_template_twig_node_includeasset extends Twig_Node
|
||||
namespace phpbb\template\twig\node;
|
||||
|
||||
class includeasset extends \Twig_Node
|
||||
{
|
||||
/** @var Twig_Environment */
|
||||
protected $environment;
|
||||
|
||||
public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $lineno, $tag = null)
|
||||
public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
|
||||
{
|
||||
$this->environment = $environment;
|
||||
|
||||
@@ -23,7 +25,7 @@ class phpbb_template_twig_node_includeasset extends Twig_Node
|
||||
*
|
||||
* @param Twig_Compiler A Twig_Compiler instance
|
||||
*/
|
||||
public function compile(Twig_Compiler $compiler)
|
||||
public function compile(\Twig_Compiler $compiler)
|
||||
{
|
||||
$compiler->addDebugInfo($this);
|
||||
|
||||
@@ -33,7 +35,7 @@ class phpbb_template_twig_node_includeasset extends Twig_Node
|
||||
->write("\$asset_file = ")
|
||||
->subcompile($this->getNode('expr'))
|
||||
->raw(";\n")
|
||||
->write("\$asset = new phpbb_template_asset(\$asset_file);\n")
|
||||
->write("\$asset = new \phpbb\template\asset(\$asset_file);\n")
|
||||
->write("if (substr(\$asset_file, 0, 2) !== './' && \$asset->is_relative()) {\n")
|
||||
->indent()
|
||||
->write("\$asset_path = \$asset->get_path();")
|
||||
|
@@ -7,7 +7,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
class phpbb_template_twig_node_includecss extends phpbb_template_twig_node_includeasset
|
||||
namespace phpbb\template\twig\node;
|
||||
|
||||
class includecss extends \phpbb\template\twig\node\includeasset
|
||||
{
|
||||
public function get_definition_name()
|
||||
{
|
||||
@@ -19,7 +21,7 @@ class phpbb_template_twig_node_includecss extends phpbb_template_twig_node_inclu
|
||||
*
|
||||
* @param Twig_Compiler A Twig_Compiler instance
|
||||
*/
|
||||
public function append_asset(Twig_Compiler $compiler)
|
||||
public function append_asset(\Twig_Compiler $compiler)
|
||||
{
|
||||
$compiler
|
||||
->raw("<link href=\"' . ")
|
||||
|
@@ -7,7 +7,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
class phpbb_template_twig_node_includejs extends phpbb_template_twig_node_includeasset
|
||||
namespace phpbb\template\twig\node;
|
||||
|
||||
class includejs extends \phpbb\template\twig\node\includeasset
|
||||
{
|
||||
public function get_definition_name()
|
||||
{
|
||||
@@ -19,7 +21,7 @@ class phpbb_template_twig_node_includejs extends phpbb_template_twig_node_includ
|
||||
*
|
||||
* @param Twig_Compiler A Twig_Compiler instance
|
||||
*/
|
||||
protected function append_asset(Twig_Compiler $compiler)
|
||||
protected function append_asset(\Twig_Compiler $compiler)
|
||||
{
|
||||
$config = $this->environment->get_phpbb_config();
|
||||
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\template\twig\node;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -16,14 +18,14 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
|
||||
class phpbb_template_twig_node_includenode extends Twig_Node_Include
|
||||
class includenode extends \Twig_Node_Include
|
||||
{
|
||||
/**
|
||||
* Compiles the node to PHP.
|
||||
*
|
||||
* @param Twig_Compiler A Twig_Compiler instance
|
||||
*/
|
||||
public function compile(Twig_Compiler $compiler)
|
||||
public function compile(\Twig_Compiler $compiler)
|
||||
{
|
||||
$compiler->addDebugInfo($this);
|
||||
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\template\twig\node;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -16,12 +18,12 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
|
||||
class phpbb_template_twig_node_includephp extends Twig_Node
|
||||
class includephp extends \Twig_Node
|
||||
{
|
||||
/** @var Twig_Environment */
|
||||
protected $environment;
|
||||
|
||||
public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $ignoreMissing = false, $lineno, $tag = null)
|
||||
public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $ignoreMissing = false, $lineno, $tag = null)
|
||||
{
|
||||
$this->environment = $environment;
|
||||
|
||||
@@ -33,7 +35,7 @@ class phpbb_template_twig_node_includephp extends Twig_Node
|
||||
*
|
||||
* @param Twig_Compiler A Twig_Compiler instance
|
||||
*/
|
||||
public function compile(Twig_Compiler $compiler)
|
||||
public function compile(\Twig_Compiler $compiler)
|
||||
{
|
||||
$compiler->addDebugInfo($this);
|
||||
|
||||
@@ -80,7 +82,7 @@ class phpbb_template_twig_node_includephp extends Twig_Node
|
||||
if ($this->getAttribute('ignore_missing')) {
|
||||
$compiler
|
||||
->outdent()
|
||||
->write("} catch (Twig_Error_Loader \$e) {\n")
|
||||
->write("} catch (\Twig_Error_Loader \$e) {\n")
|
||||
->indent()
|
||||
->write("// ignore missing template\n")
|
||||
->outdent()
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\template\twig\node;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -16,12 +18,12 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
|
||||
class phpbb_template_twig_node_php extends Twig_Node
|
||||
class php extends \Twig_Node
|
||||
{
|
||||
/** @var Twig_Environment */
|
||||
protected $environment;
|
||||
|
||||
public function __construct(Twig_Node_Text $text, phpbb_template_twig_environment $environment, $lineno, $tag = null)
|
||||
public function __construct(\Twig_Node_Text $text, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
|
||||
{
|
||||
$this->environment = $environment;
|
||||
|
||||
@@ -33,7 +35,7 @@ class phpbb_template_twig_node_php extends Twig_Node
|
||||
*
|
||||
* @param Twig_Compiler A Twig_Compiler instance
|
||||
*/
|
||||
public function compile(Twig_Compiler $compiler)
|
||||
public function compile(\Twig_Compiler $compiler)
|
||||
{
|
||||
$compiler->addDebugInfo($this);
|
||||
|
||||
|
Reference in New Issue
Block a user