From 27f3155330baa667b69eb4f45df4b9e09df396f6 Mon Sep 17 00:00:00 2001 From: nikic <+@ni-po.com> Date: Thu, 23 Dec 2010 16:22:26 +0100 Subject: [PATCH] add Twig_Compiler type hints --- doc/advanced.rst | 2 +- lib/Twig/Node.php | 2 +- lib/Twig/Node/AutoEscape.php | 2 +- lib/Twig/Node/Block.php | 2 +- lib/Twig/Node/BlockReference.php | 2 +- lib/Twig/Node/Expression/Array.php | 2 +- lib/Twig/Node/Expression/AssignName.php | 2 +- lib/Twig/Node/Expression/Binary.php | 4 ++-- lib/Twig/Node/Expression/Binary/Add.php | 2 +- lib/Twig/Node/Expression/Binary/And.php | 2 +- lib/Twig/Node/Expression/Binary/Concat.php | 2 +- lib/Twig/Node/Expression/Binary/Div.php | 2 +- lib/Twig/Node/Expression/Binary/Equal.php | 2 +- lib/Twig/Node/Expression/Binary/FloorDiv.php | 4 ++-- lib/Twig/Node/Expression/Binary/Greater.php | 2 +- lib/Twig/Node/Expression/Binary/GreaterEqual.php | 2 +- lib/Twig/Node/Expression/Binary/In.php | 4 ++-- lib/Twig/Node/Expression/Binary/Less.php | 2 +- lib/Twig/Node/Expression/Binary/LessEqual.php | 2 +- lib/Twig/Node/Expression/Binary/Mod.php | 2 +- lib/Twig/Node/Expression/Binary/Mul.php | 2 +- lib/Twig/Node/Expression/Binary/NotEqual.php | 2 +- lib/Twig/Node/Expression/Binary/NotIn.php | 4 ++-- lib/Twig/Node/Expression/Binary/Or.php | 2 +- lib/Twig/Node/Expression/Binary/Power.php | 4 ++-- lib/Twig/Node/Expression/Binary/Range.php | 4 ++-- lib/Twig/Node/Expression/Binary/Sub.php | 2 +- lib/Twig/Node/Expression/BlockReference.php | 2 +- lib/Twig/Node/Expression/Conditional.php | 2 +- lib/Twig/Node/Expression/Constant.php | 2 +- lib/Twig/Node/Expression/ExtensionReference.php | 2 +- lib/Twig/Node/Expression/Filter.php | 4 ++-- lib/Twig/Node/Expression/Function.php | 2 +- lib/Twig/Node/Expression/GetAttr.php | 2 +- lib/Twig/Node/Expression/Name.php | 2 +- lib/Twig/Node/Expression/Parent.php | 2 +- lib/Twig/Node/Expression/Test.php | 2 +- lib/Twig/Node/Expression/Unary.php | 4 ++-- lib/Twig/Node/Expression/Unary/Neg.php | 2 +- lib/Twig/Node/Expression/Unary/Not.php | 2 +- lib/Twig/Node/Expression/Unary/Pos.php | 2 +- lib/Twig/Node/For.php | 2 +- lib/Twig/Node/If.php | 2 +- lib/Twig/Node/Import.php | 2 +- lib/Twig/Node/Include.php | 2 +- lib/Twig/Node/Macro.php | 2 +- lib/Twig/Node/Module.php | 22 +++++++++++----------- lib/Twig/Node/Print.php | 2 +- lib/Twig/Node/Sandbox.php | 2 +- lib/Twig/Node/SandboxedModule.php | 4 ++-- lib/Twig/Node/SandboxedPrint.php | 2 +- lib/Twig/Node/Set.php | 2 +- lib/Twig/Node/Spaceless.php | 2 +- lib/Twig/Node/Text.php | 2 +- lib/Twig/NodeInterface.php | 2 +- 55 files changed, 74 insertions(+), 74 deletions(-) diff --git a/doc/advanced.rst b/doc/advanced.rst index 28a1d8f..7ca26fc 100644 --- a/doc/advanced.rst +++ b/doc/advanced.rst @@ -378,7 +378,7 @@ The ``Project_Set_Node`` class itself is rather simple:: parent::__construct(array('value' => $value), array('name' => $name), $lineno); } - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) diff --git a/lib/Twig/Node.php b/lib/Twig/Node.php index 350896c..3274b59 100644 --- a/lib/Twig/Node.php +++ b/lib/Twig/Node.php @@ -100,7 +100,7 @@ class Twig_Node implements Twig_NodeInterface, Countable, IteratorAggregate return $asDom ? $dom : $dom->saveXml(); } - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { foreach ($this->nodes as $node) { $node->compile($compiler); diff --git a/lib/Twig/Node/AutoEscape.php b/lib/Twig/Node/AutoEscape.php index e079ef5..42816ac 100644 --- a/lib/Twig/Node/AutoEscape.php +++ b/lib/Twig/Node/AutoEscape.php @@ -33,7 +33,7 @@ class Twig_Node_AutoEscape extends Twig_Node * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler->subcompile($this->getNode('body')); } diff --git a/lib/Twig/Node/Block.php b/lib/Twig/Node/Block.php index 7ccc289..7bdb9b9 100644 --- a/lib/Twig/Node/Block.php +++ b/lib/Twig/Node/Block.php @@ -28,7 +28,7 @@ class Twig_Node_Block extends Twig_Node * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) diff --git a/lib/Twig/Node/BlockReference.php b/lib/Twig/Node/BlockReference.php index 23097f5..42a62be 100644 --- a/lib/Twig/Node/BlockReference.php +++ b/lib/Twig/Node/BlockReference.php @@ -28,7 +28,7 @@ class Twig_Node_BlockReference extends Twig_Node implements Twig_NodeOutputInter * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) diff --git a/lib/Twig/Node/Expression/Array.php b/lib/Twig/Node/Expression/Array.php index b6f01a0..2d86082 100644 --- a/lib/Twig/Node/Expression/Array.php +++ b/lib/Twig/Node/Expression/Array.php @@ -20,7 +20,7 @@ class Twig_Node_Expression_Array extends Twig_Node_Expression * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler->raw('array('); $first = true; diff --git a/lib/Twig/Node/Expression/AssignName.php b/lib/Twig/Node/Expression/AssignName.php index e5b0d71..67f1250 100644 --- a/lib/Twig/Node/Expression/AssignName.php +++ b/lib/Twig/Node/Expression/AssignName.php @@ -17,7 +17,7 @@ class Twig_Node_Expression_AssignName extends Twig_Node_Expression_Name * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler->raw(sprintf('$context[\'%s\']', $this->getAttribute('name'))); } diff --git a/lib/Twig/Node/Expression/Binary.php b/lib/Twig/Node/Expression/Binary.php index 464d441..9dd5de2 100644 --- a/lib/Twig/Node/Expression/Binary.php +++ b/lib/Twig/Node/Expression/Binary.php @@ -21,7 +21,7 @@ abstract class Twig_Node_Expression_Binary extends Twig_Node_Expression * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->raw('(') @@ -36,5 +36,5 @@ abstract class Twig_Node_Expression_Binary extends Twig_Node_Expression ; } - abstract public function operator($compiler); + abstract public function operator(Twig_Compiler $compiler); } diff --git a/lib/Twig/Node/Expression/Binary/Add.php b/lib/Twig/Node/Expression/Binary/Add.php index df0712a..0ef8e11 100644 --- a/lib/Twig/Node/Expression/Binary/Add.php +++ b/lib/Twig/Node/Expression/Binary/Add.php @@ -11,7 +11,7 @@ */ class Twig_Node_Expression_Binary_Add extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('+'); } diff --git a/lib/Twig/Node/Expression/Binary/And.php b/lib/Twig/Node/Expression/Binary/And.php index 8cecf44..d5752eb 100644 --- a/lib/Twig/Node/Expression/Binary/And.php +++ b/lib/Twig/Node/Expression/Binary/And.php @@ -11,7 +11,7 @@ */ class Twig_Node_Expression_Binary_And extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('&&'); } diff --git a/lib/Twig/Node/Expression/Binary/Concat.php b/lib/Twig/Node/Expression/Binary/Concat.php index 573dea8..f9a6462 100644 --- a/lib/Twig/Node/Expression/Binary/Concat.php +++ b/lib/Twig/Node/Expression/Binary/Concat.php @@ -11,7 +11,7 @@ */ class Twig_Node_Expression_Binary_Concat extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('.'); } diff --git a/lib/Twig/Node/Expression/Binary/Div.php b/lib/Twig/Node/Expression/Binary/Div.php index d481e5d..e0797a6 100644 --- a/lib/Twig/Node/Expression/Binary/Div.php +++ b/lib/Twig/Node/Expression/Binary/Div.php @@ -11,7 +11,7 @@ */ class Twig_Node_Expression_Binary_Div extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('/'); } diff --git a/lib/Twig/Node/Expression/Binary/Equal.php b/lib/Twig/Node/Expression/Binary/Equal.php index d28140e..7b1236d 100644 --- a/lib/Twig/Node/Expression/Binary/Equal.php +++ b/lib/Twig/Node/Expression/Binary/Equal.php @@ -10,7 +10,7 @@ */ class Twig_Node_Expression_Binary_Equal extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('=='); } diff --git a/lib/Twig/Node/Expression/Binary/FloorDiv.php b/lib/Twig/Node/Expression/Binary/FloorDiv.php index 1f69885..e86b1ea 100644 --- a/lib/Twig/Node/Expression/Binary/FloorDiv.php +++ b/lib/Twig/Node/Expression/Binary/FloorDiv.php @@ -15,14 +15,14 @@ class Twig_Node_Expression_Binary_FloorDiv extends Twig_Node_Expression_Binary * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler->raw('floor('); parent::compile($compiler); $compiler->raw(')'); } - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('/'); } diff --git a/lib/Twig/Node/Expression/Binary/Greater.php b/lib/Twig/Node/Expression/Binary/Greater.php index 3cc8e1c..a110bd9 100644 --- a/lib/Twig/Node/Expression/Binary/Greater.php +++ b/lib/Twig/Node/Expression/Binary/Greater.php @@ -10,7 +10,7 @@ */ class Twig_Node_Expression_Binary_Greater extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('>'); } diff --git a/lib/Twig/Node/Expression/Binary/GreaterEqual.php b/lib/Twig/Node/Expression/Binary/GreaterEqual.php index 7fe974b..3754fed 100644 --- a/lib/Twig/Node/Expression/Binary/GreaterEqual.php +++ b/lib/Twig/Node/Expression/Binary/GreaterEqual.php @@ -10,7 +10,7 @@ */ class Twig_Node_Expression_Binary_GreaterEqual extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('>='); } diff --git a/lib/Twig/Node/Expression/Binary/In.php b/lib/Twig/Node/Expression/Binary/In.php index b59544e..788f937 100644 --- a/lib/Twig/Node/Expression/Binary/In.php +++ b/lib/Twig/Node/Expression/Binary/In.php @@ -15,7 +15,7 @@ class Twig_Node_Expression_Binary_In extends Twig_Node_Expression_Binary * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->raw('twig_in_filter(') @@ -26,7 +26,7 @@ class Twig_Node_Expression_Binary_In extends Twig_Node_Expression_Binary ; } - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('in'); } diff --git a/lib/Twig/Node/Expression/Binary/Less.php b/lib/Twig/Node/Expression/Binary/Less.php index 42fc5df..45fd300 100644 --- a/lib/Twig/Node/Expression/Binary/Less.php +++ b/lib/Twig/Node/Expression/Binary/Less.php @@ -10,7 +10,7 @@ */ class Twig_Node_Expression_Binary_Less extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('<'); } diff --git a/lib/Twig/Node/Expression/Binary/LessEqual.php b/lib/Twig/Node/Expression/Binary/LessEqual.php index 0f4b52c..e38e257 100644 --- a/lib/Twig/Node/Expression/Binary/LessEqual.php +++ b/lib/Twig/Node/Expression/Binary/LessEqual.php @@ -10,7 +10,7 @@ */ class Twig_Node_Expression_Binary_LessEqual extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('<='); } diff --git a/lib/Twig/Node/Expression/Binary/Mod.php b/lib/Twig/Node/Expression/Binary/Mod.php index da20b1b..9924114 100644 --- a/lib/Twig/Node/Expression/Binary/Mod.php +++ b/lib/Twig/Node/Expression/Binary/Mod.php @@ -11,7 +11,7 @@ */ class Twig_Node_Expression_Binary_Mod extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('%'); } diff --git a/lib/Twig/Node/Expression/Binary/Mul.php b/lib/Twig/Node/Expression/Binary/Mul.php index d6ecd57..c91529c 100644 --- a/lib/Twig/Node/Expression/Binary/Mul.php +++ b/lib/Twig/Node/Expression/Binary/Mul.php @@ -11,7 +11,7 @@ */ class Twig_Node_Expression_Binary_Mul extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('*'); } diff --git a/lib/Twig/Node/Expression/Binary/NotEqual.php b/lib/Twig/Node/Expression/Binary/NotEqual.php index 84bee67..26867ba 100644 --- a/lib/Twig/Node/Expression/Binary/NotEqual.php +++ b/lib/Twig/Node/Expression/Binary/NotEqual.php @@ -10,7 +10,7 @@ */ class Twig_Node_Expression_Binary_NotEqual extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('!='); } diff --git a/lib/Twig/Node/Expression/Binary/NotIn.php b/lib/Twig/Node/Expression/Binary/NotIn.php index 486e879..f347b7b 100644 --- a/lib/Twig/Node/Expression/Binary/NotIn.php +++ b/lib/Twig/Node/Expression/Binary/NotIn.php @@ -15,7 +15,7 @@ class Twig_Node_Expression_Binary_NotIn extends Twig_Node_Expression_Binary * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->raw('!twig_in_filter(') @@ -26,7 +26,7 @@ class Twig_Node_Expression_Binary_NotIn extends Twig_Node_Expression_Binary ; } - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('not in'); } diff --git a/lib/Twig/Node/Expression/Binary/Or.php b/lib/Twig/Node/Expression/Binary/Or.php index c4d733a..adba49c 100644 --- a/lib/Twig/Node/Expression/Binary/Or.php +++ b/lib/Twig/Node/Expression/Binary/Or.php @@ -11,7 +11,7 @@ */ class Twig_Node_Expression_Binary_Or extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('||'); } diff --git a/lib/Twig/Node/Expression/Binary/Power.php b/lib/Twig/Node/Expression/Binary/Power.php index 4eede5e..b2c5904 100644 --- a/lib/Twig/Node/Expression/Binary/Power.php +++ b/lib/Twig/Node/Expression/Binary/Power.php @@ -15,7 +15,7 @@ class Twig_Node_Expression_Binary_Power extends Twig_Node_Expression_Binary * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->raw('pow(') @@ -26,7 +26,7 @@ class Twig_Node_Expression_Binary_Power extends Twig_Node_Expression_Binary ; } - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('**'); } diff --git a/lib/Twig/Node/Expression/Binary/Range.php b/lib/Twig/Node/Expression/Binary/Range.php index 635bb0d..bea4f2a 100644 --- a/lib/Twig/Node/Expression/Binary/Range.php +++ b/lib/Twig/Node/Expression/Binary/Range.php @@ -15,7 +15,7 @@ class Twig_Node_Expression_Binary_Range extends Twig_Node_Expression_Binary * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->raw('range(') @@ -26,7 +26,7 @@ class Twig_Node_Expression_Binary_Range extends Twig_Node_Expression_Binary ; } - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('..'); } diff --git a/lib/Twig/Node/Expression/Binary/Sub.php b/lib/Twig/Node/Expression/Binary/Sub.php index ede0f1e..d446399 100644 --- a/lib/Twig/Node/Expression/Binary/Sub.php +++ b/lib/Twig/Node/Expression/Binary/Sub.php @@ -11,7 +11,7 @@ */ class Twig_Node_Expression_Binary_Sub extends Twig_Node_Expression_Binary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { return $compiler->raw('-'); } diff --git a/lib/Twig/Node/Expression/BlockReference.php b/lib/Twig/Node/Expression/BlockReference.php index 2dea781..259967c 100644 --- a/lib/Twig/Node/Expression/BlockReference.php +++ b/lib/Twig/Node/Expression/BlockReference.php @@ -28,7 +28,7 @@ class Twig_Node_Expression_BlockReference extends Twig_Node_Expression * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->raw("\$this->renderBlock(") diff --git a/lib/Twig/Node/Expression/Conditional.php b/lib/Twig/Node/Expression/Conditional.php index c6f3e98..cefb9a2 100644 --- a/lib/Twig/Node/Expression/Conditional.php +++ b/lib/Twig/Node/Expression/Conditional.php @@ -16,7 +16,7 @@ class Twig_Node_Expression_Conditional extends Twig_Node_Expression parent::__construct(array('expr1' => $expr1, 'expr2' => $expr2, 'expr3' => $expr3), array(), $lineno); } - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->raw('(') diff --git a/lib/Twig/Node/Expression/Constant.php b/lib/Twig/Node/Expression/Constant.php index 9bbaa99..a91dc69 100644 --- a/lib/Twig/Node/Expression/Constant.php +++ b/lib/Twig/Node/Expression/Constant.php @@ -16,7 +16,7 @@ class Twig_Node_Expression_Constant extends Twig_Node_Expression parent::__construct(array(), array('value' => $value), $lineno); } - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler->repr($this->getAttribute('value')); } diff --git a/lib/Twig/Node/Expression/ExtensionReference.php b/lib/Twig/Node/Expression/ExtensionReference.php index d37dda8..ba5d58e 100644 --- a/lib/Twig/Node/Expression/ExtensionReference.php +++ b/lib/Twig/Node/Expression/ExtensionReference.php @@ -27,7 +27,7 @@ class Twig_Node_Expression_ExtensionReference extends Twig_Node_Expression * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler->raw(sprintf("\$this->env->getExtension('%s')", $this->getAttribute('name'))); } diff --git a/lib/Twig/Node/Expression/Filter.php b/lib/Twig/Node/Expression/Filter.php index 8181215..cf5ffb3 100644 --- a/lib/Twig/Node/Expression/Filter.php +++ b/lib/Twig/Node/Expression/Filter.php @@ -16,7 +16,7 @@ class Twig_Node_Expression_Filter extends Twig_Node_Expression parent::__construct(array('node' => $node, 'filter' => $filterName, 'arguments' => $arguments), array(), $lineno, $tag); } - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $filterMap = $compiler->getEnvironment()->getFilters(); $name = $this->getNode('filter')->getAttribute('value'); @@ -52,7 +52,7 @@ class Twig_Node_Expression_Filter extends Twig_Node_Expression } } - protected function compileFilter($compiler, $filter) + protected function compileFilter(Twig_Compiler $compiler, Twig_FilterInterface $filter) { $compiler->raw($filter->compile().($filter->needsEnvironment() ? '($this->env, ' : '(')); diff --git a/lib/Twig/Node/Expression/Function.php b/lib/Twig/Node/Expression/Function.php index e773d08..23911bc 100644 --- a/lib/Twig/Node/Expression/Function.php +++ b/lib/Twig/Node/Expression/Function.php @@ -15,7 +15,7 @@ class Twig_Node_Expression_Function extends Twig_Node_Expression parent::__construct(array('name' => $name, 'arguments' => $arguments), array(), $lineno); } - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $function = $compiler->getEnvironment()->getFunction($this->getNode('name')->getAttribute('name')); if (!$function) { diff --git a/lib/Twig/Node/Expression/GetAttr.php b/lib/Twig/Node/Expression/GetAttr.php index 64439e3..815d9fd 100644 --- a/lib/Twig/Node/Expression/GetAttr.php +++ b/lib/Twig/Node/Expression/GetAttr.php @@ -20,7 +20,7 @@ class Twig_Node_Expression_GetAttr extends Twig_Node_Expression parent::__construct(array('node' => $node, 'attribute' => $attribute, 'arguments' => $arguments), array('type' => $type), $lineno); } - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->raw('$this->getAttribute(') diff --git a/lib/Twig/Node/Expression/Name.php b/lib/Twig/Node/Expression/Name.php index f447451..6c03e93 100644 --- a/lib/Twig/Node/Expression/Name.php +++ b/lib/Twig/Node/Expression/Name.php @@ -16,7 +16,7 @@ class Twig_Node_Expression_Name extends Twig_Node_Expression parent::__construct(array(), array('name' => $name), $lineno); } - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { if ('_self' === $this->getAttribute('name')) { $compiler->raw('$this'); diff --git a/lib/Twig/Node/Expression/Parent.php b/lib/Twig/Node/Expression/Parent.php index be07cdb..7be682d 100644 --- a/lib/Twig/Node/Expression/Parent.php +++ b/lib/Twig/Node/Expression/Parent.php @@ -28,7 +28,7 @@ class Twig_Node_Expression_Parent extends Twig_Node_Expression * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->raw("\$this->renderParentBlock(") diff --git a/lib/Twig/Node/Expression/Test.php b/lib/Twig/Node/Expression/Test.php index 8ef498c..4995bc7 100644 --- a/lib/Twig/Node/Expression/Test.php +++ b/lib/Twig/Node/Expression/Test.php @@ -15,7 +15,7 @@ class Twig_Node_Expression_Test extends Twig_Node_Expression parent::__construct(array('node' => $node, 'arguments' => $arguments), array('name' => $name), $lineno); } - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $testMap = $compiler->getEnvironment()->getTests(); if (!isset($testMap[$this->getAttribute('name')])) { diff --git a/lib/Twig/Node/Expression/Unary.php b/lib/Twig/Node/Expression/Unary.php index c11c599..c514388 100644 --- a/lib/Twig/Node/Expression/Unary.php +++ b/lib/Twig/Node/Expression/Unary.php @@ -16,7 +16,7 @@ abstract class Twig_Node_Expression_Unary extends Twig_Node_Expression parent::__construct(array('node' => $node), array(), $lineno); } - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler->raw('('); $this->operator($compiler); @@ -26,5 +26,5 @@ abstract class Twig_Node_Expression_Unary extends Twig_Node_Expression ; } - abstract public function operator($compiler); + abstract public function operator(Twig_Compiler $compiler); } diff --git a/lib/Twig/Node/Expression/Unary/Neg.php b/lib/Twig/Node/Expression/Unary/Neg.php index 699ff06..2a3937e 100644 --- a/lib/Twig/Node/Expression/Unary/Neg.php +++ b/lib/Twig/Node/Expression/Unary/Neg.php @@ -11,7 +11,7 @@ */ class Twig_Node_Expression_Unary_Neg extends Twig_Node_Expression_Unary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { $compiler->raw('-'); } diff --git a/lib/Twig/Node/Expression/Unary/Not.php b/lib/Twig/Node/Expression/Unary/Not.php index 47d83c7..f94073c 100644 --- a/lib/Twig/Node/Expression/Unary/Not.php +++ b/lib/Twig/Node/Expression/Unary/Not.php @@ -11,7 +11,7 @@ */ class Twig_Node_Expression_Unary_Not extends Twig_Node_Expression_Unary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { $compiler->raw('!'); } diff --git a/lib/Twig/Node/Expression/Unary/Pos.php b/lib/Twig/Node/Expression/Unary/Pos.php index 90865fe..04edb52 100644 --- a/lib/Twig/Node/Expression/Unary/Pos.php +++ b/lib/Twig/Node/Expression/Unary/Pos.php @@ -11,7 +11,7 @@ */ class Twig_Node_Expression_Unary_Pos extends Twig_Node_Expression_Unary { - public function operator($compiler) + public function operator(Twig_Compiler $compiler) { $compiler->raw('+'); } diff --git a/lib/Twig/Node/For.php b/lib/Twig/Node/For.php index ee0d0e0..d565236 100644 --- a/lib/Twig/Node/For.php +++ b/lib/Twig/Node/For.php @@ -28,7 +28,7 @@ class Twig_Node_For extends Twig_Node * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) diff --git a/lib/Twig/Node/If.php b/lib/Twig/Node/If.php index 7150874..b222222 100644 --- a/lib/Twig/Node/If.php +++ b/lib/Twig/Node/If.php @@ -28,7 +28,7 @@ class Twig_Node_If extends Twig_Node * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler->addDebugInfo($this); for ($i = 0; $i < count($this->getNode('tests')); $i += 2) { diff --git a/lib/Twig/Node/Import.php b/lib/Twig/Node/Import.php index 1314b3f..746284d 100644 --- a/lib/Twig/Node/Import.php +++ b/lib/Twig/Node/Import.php @@ -27,7 +27,7 @@ class Twig_Node_Import extends Twig_Node * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) diff --git a/lib/Twig/Node/Include.php b/lib/Twig/Node/Include.php index 3be3832..75ec6cc 100644 --- a/lib/Twig/Node/Include.php +++ b/lib/Twig/Node/Include.php @@ -28,7 +28,7 @@ class Twig_Node_Include extends Twig_Node implements Twig_NodeOutputInterface * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler->addDebugInfo($this); diff --git a/lib/Twig/Node/Macro.php b/lib/Twig/Node/Macro.php index 62f2da1..2bfe16f 100644 --- a/lib/Twig/Node/Macro.php +++ b/lib/Twig/Node/Macro.php @@ -27,7 +27,7 @@ class Twig_Node_Macro extends Twig_Node * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $arguments = array(); foreach ($this->getNode('arguments') as $argument) { diff --git a/lib/Twig/Node/Module.php b/lib/Twig/Node/Module.php index 2355d7c..111f029 100644 --- a/lib/Twig/Node/Module.php +++ b/lib/Twig/Node/Module.php @@ -28,12 +28,12 @@ class Twig_Node_Module extends Twig_Node * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $this->compileTemplate($compiler); } - protected function compileTemplate($compiler) + protected function compileTemplate(Twig_Compiler $compiler) { $this->compileClassHeader($compiler); @@ -58,7 +58,7 @@ class Twig_Node_Module extends Twig_Node $this->compileClassFooter($compiler); } - protected function compileGetParent($compiler) + protected function compileGetParent(Twig_Compiler $compiler) { if (null === $this->getNode('parent')) { return; @@ -100,7 +100,7 @@ class Twig_Node_Module extends Twig_Node ; } - protected function compileDisplayBody($compiler) + protected function compileDisplayBody(Twig_Compiler $compiler) { $compiler->write("\$context = array_merge(\$this->env->getGlobals(), \$context);\n\n"); @@ -120,7 +120,7 @@ class Twig_Node_Module extends Twig_Node } } - protected function compileClassHeader($compiler) + protected function compileClassHeader(Twig_Compiler $compiler) { $compiler ->write("write("public function __construct(Twig_Environment \$env)\n", "{\n") @@ -161,7 +161,7 @@ class Twig_Node_Module extends Twig_Node ; } - protected function compileDisplayHeader($compiler) + protected function compileDisplayHeader(Twig_Compiler $compiler) { $compiler ->write("public function display(array \$context, array \$blocks = array())\n", "{\n") @@ -169,7 +169,7 @@ class Twig_Node_Module extends Twig_Node ; } - protected function compileDisplayFooter($compiler) + protected function compileDisplayFooter(Twig_Compiler $compiler) { $compiler ->outdent() @@ -177,7 +177,7 @@ class Twig_Node_Module extends Twig_Node ; } - protected function compileClassFooter($compiler) + protected function compileClassFooter(Twig_Compiler $compiler) { $compiler ->outdent() @@ -185,12 +185,12 @@ class Twig_Node_Module extends Twig_Node ; } - protected function compileMacros($compiler) + protected function compileMacros(Twig_Compiler $compiler) { $compiler->subcompile($this->getNode('macros')); } - protected function compileGetTemplateName($compiler) + protected function compileGetTemplateName(Twig_Compiler $compiler) { $compiler ->write("public function getTemplateName()\n", "{\n") diff --git a/lib/Twig/Node/Print.php b/lib/Twig/Node/Print.php index 0746c4d..49047c9 100644 --- a/lib/Twig/Node/Print.php +++ b/lib/Twig/Node/Print.php @@ -28,7 +28,7 @@ class Twig_Node_Print extends Twig_Node implements Twig_NodeOutputInterface * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) diff --git a/lib/Twig/Node/Sandbox.php b/lib/Twig/Node/Sandbox.php index c5660c8..0a513c0 100644 --- a/lib/Twig/Node/Sandbox.php +++ b/lib/Twig/Node/Sandbox.php @@ -27,7 +27,7 @@ class Twig_Node_Sandbox extends Twig_Node * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) diff --git a/lib/Twig/Node/SandboxedModule.php b/lib/Twig/Node/SandboxedModule.php index d03df81..35c7aff 100644 --- a/lib/Twig/Node/SandboxedModule.php +++ b/lib/Twig/Node/SandboxedModule.php @@ -31,7 +31,7 @@ class Twig_Node_SandboxedModule extends Twig_Node_Module $this->usedFunctions = $usedFunctions; } - protected function compileDisplayBody($compiler) + protected function compileDisplayBody(Twig_Compiler $compiler) { if (null === $this->getNode('parent')) { $compiler->write("\$this->checkSecurity();\n"); @@ -40,7 +40,7 @@ class Twig_Node_SandboxedModule extends Twig_Node_Module parent::compileDisplayBody($compiler); } - protected function compileDisplayFooter($compiler) + protected function compileDisplayFooter(Twig_Compiler $compiler) { parent::compileDisplayFooter($compiler); diff --git a/lib/Twig/Node/SandboxedPrint.php b/lib/Twig/Node/SandboxedPrint.php index c24cee4..619ff99 100644 --- a/lib/Twig/Node/SandboxedPrint.php +++ b/lib/Twig/Node/SandboxedPrint.php @@ -32,7 +32,7 @@ class Twig_Node_SandboxedPrint extends Twig_Node_Print * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) diff --git a/lib/Twig/Node/Set.php b/lib/Twig/Node/Set.php index 001d69b..04be00e 100644 --- a/lib/Twig/Node/Set.php +++ b/lib/Twig/Node/Set.php @@ -27,7 +27,7 @@ class Twig_Node_Set extends Twig_Node * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler->addDebugInfo($this); diff --git a/lib/Twig/Node/Spaceless.php b/lib/Twig/Node/Spaceless.php index c7fddda..8c6300d 100644 --- a/lib/Twig/Node/Spaceless.php +++ b/lib/Twig/Node/Spaceless.php @@ -29,7 +29,7 @@ class Twig_Node_Spaceless extends Twig_Node * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) diff --git a/lib/Twig/Node/Text.php b/lib/Twig/Node/Text.php index f664e33..7812bc2 100644 --- a/lib/Twig/Node/Text.php +++ b/lib/Twig/Node/Text.php @@ -28,7 +28,7 @@ class Twig_Node_Text extends Twig_Node implements Twig_NodeOutputInterface * * @param Twig_Compiler A Twig_Compiler instance */ - public function compile($compiler) + public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) diff --git a/lib/Twig/NodeInterface.php b/lib/Twig/NodeInterface.php index 7e5626c..5e17b77 100644 --- a/lib/Twig/NodeInterface.php +++ b/lib/Twig/NodeInterface.php @@ -22,7 +22,7 @@ interface Twig_NodeInterface * * @param Twig_Compiler A Twig_Compiler instance */ - function compile($compiler); + function compile(Twig_Compiler $compiler); function getLine(); -- 1.7.2.5