mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 19:36:43 +00:00
minor #1786 move property initialization to the declaration when possible (Tobion)
This PR was merged into the 1.x branch.
Discussion
----------
move property initialization to the declaration when possible
From #1781
Commits
-------
5951d1f move property initialization to the declaration when possible
This commit is contained in:
@@ -21,7 +21,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
||||
protected $source;
|
||||
protected $indentation;
|
||||
protected $env;
|
||||
protected $debugInfo;
|
||||
protected $debugInfo = array();
|
||||
protected $sourceOffset;
|
||||
protected $sourceLine;
|
||||
protected $filename;
|
||||
@@ -34,7 +34,6 @@ class Twig_Compiler implements Twig_CompilerInterface
|
||||
public function __construct(Twig_Environment $env)
|
||||
{
|
||||
$this->env = $env;
|
||||
$this->debugInfo = array();
|
||||
}
|
||||
|
||||
public function getFilename()
|
||||
|
||||
@@ -34,15 +34,15 @@ class Twig_Environment
|
||||
protected $tests;
|
||||
protected $functions;
|
||||
protected $globals;
|
||||
protected $runtimeInitialized;
|
||||
protected $extensionInitialized;
|
||||
protected $runtimeInitialized = false;
|
||||
protected $extensionInitialized = false;
|
||||
protected $loadedTemplates;
|
||||
protected $strictVariables;
|
||||
protected $unaryOperators;
|
||||
protected $binaryOperators;
|
||||
protected $templateClassPrefix = '__TwigTemplate_';
|
||||
protected $functionCallbacks;
|
||||
protected $filterCallbacks;
|
||||
protected $functionCallbacks = array();
|
||||
protected $filterCallbacks = array();
|
||||
protected $staging;
|
||||
|
||||
/**
|
||||
@@ -106,15 +106,11 @@ class Twig_Environment
|
||||
$this->baseTemplateClass = $options['base_template_class'];
|
||||
$this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload'];
|
||||
$this->strictVariables = (bool) $options['strict_variables'];
|
||||
$this->runtimeInitialized = false;
|
||||
$this->setCache($options['cache']);
|
||||
$this->functionCallbacks = array();
|
||||
$this->filterCallbacks = array();
|
||||
|
||||
$this->addExtension(new Twig_Extension_Core());
|
||||
$this->addExtension(new Twig_Extension_Escaper($options['autoescape']));
|
||||
$this->addExtension(new Twig_Extension_Optimizer($options['optimizations']));
|
||||
$this->extensionInitialized = false;
|
||||
$this->staging = new Twig_Extension_Staging();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
|
||||
class Twig_Extension_Profiler extends Twig_Extension
|
||||
{
|
||||
private $actives;
|
||||
private $actives = array();
|
||||
|
||||
public function __construct(Twig_Profiler_Profile $profile)
|
||||
{
|
||||
$this->actives = array($profile);
|
||||
$this->actives[] = $profile;
|
||||
}
|
||||
|
||||
public function enter(Twig_Profiler_Profile $profile)
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
class Twig_NodeTraverser
|
||||
{
|
||||
protected $env;
|
||||
protected $visitors;
|
||||
protected $visitors = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -30,7 +30,6 @@ class Twig_NodeTraverser
|
||||
public function __construct(Twig_Environment $env, array $visitors = array())
|
||||
{
|
||||
$this->env = $env;
|
||||
$this->visitors = array();
|
||||
foreach ($visitors as $visitor) {
|
||||
$this->addVisitor($visitor);
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
||||
protected $parent;
|
||||
protected $parents = array();
|
||||
protected $env;
|
||||
protected $blocks;
|
||||
protected $traits;
|
||||
protected $blocks = array();
|
||||
protected $traits = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -33,8 +33,6 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
||||
public function __construct(Twig_Environment $env)
|
||||
{
|
||||
$this->env = $env;
|
||||
$this->blocks = array();
|
||||
$this->traits = array();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
class Twig_TokenStream
|
||||
{
|
||||
protected $tokens;
|
||||
protected $current;
|
||||
protected $current = 0;
|
||||
protected $filename;
|
||||
|
||||
/**
|
||||
@@ -30,7 +30,6 @@ class Twig_TokenStream
|
||||
public function __construct(array $tokens, $filename = null)
|
||||
{
|
||||
$this->tokens = $tokens;
|
||||
$this->current = 0;
|
||||
$this->filename = $filename;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user