@@ -267,6 +267,9 @@ |
||
267 | 267 | ; |
268 | 268 | } |
269 | 269 | |
270 | + /** |
|
271 | + * @param string $var |
|
272 | + */ |
|
270 | 273 | public function compileLoadTemplate(JsCompiler $compiler, $node, $var) |
271 | 274 | { |
272 | 275 | $compiler->isTemplateName = true; |
@@ -104,7 +104,7 @@ |
||
104 | 104 | ->write(sprintf("if (!trait_%s.isTraitable()) {\n", $i)) |
105 | 105 | ->indent() |
106 | 106 | ->write( |
107 | - "throw Error('Template \"' + trait_".$i.".getTemplateName() + " . |
|
107 | + "throw Error('Template \"' + trait_".$i.".getTemplateName() + ". |
|
108 | 108 | "'\" cannot be used as a trait.');\n" |
109 | 109 | )->outdent() |
110 | 110 | ->write("}\n") |
@@ -251,7 +251,6 @@ discard block |
||
251 | 251 | /** |
252 | 252 | * Returns the function name for the given template name. |
253 | 253 | * |
254 | - * @param \Twig_Node_Module $templateName |
|
255 | 254 | * @return string |
256 | 255 | */ |
257 | 256 | final public function getFunctionName(\Twig_Node_Module $module) |
@@ -372,6 +371,9 @@ discard block |
||
372 | 371 | return $this; |
373 | 372 | } |
374 | 373 | |
374 | + /** |
|
375 | + * @param string $localName |
|
376 | + */ |
|
375 | 377 | public function setVar($var, $localName) |
376 | 378 | { |
377 | 379 | $this->localVarMap[$var] = |
@@ -387,6 +389,9 @@ discard block |
||
387 | 389 | return $this; |
388 | 390 | } |
389 | 391 | |
392 | + /** |
|
393 | + * @param boolean $bool |
|
394 | + */ |
|
390 | 395 | public function setTemplateName($bool) |
391 | 396 | { |
392 | 397 | $this->isTemplateName = (Boolean) $bool; |
@@ -84,7 +84,7 @@ |
||
84 | 84 | ; |
85 | 85 | |
86 | 86 | if ($count > 0) { |
87 | - $parentSuffix = ($count-1 > 0) ? $count - 1 : ''; |
|
87 | + $parentSuffix = ($count - 1 > 0) ? $count - 1 : ''; |
|
88 | 88 | |
89 | 89 | $compiler |
90 | 90 | ->write("'parent': loop$parentSuffix,\n") |
@@ -14,12 +14,12 @@ |
||
14 | 14 | |
15 | 15 | public function compile(JsCompiler $compiler, \Twig_NodeInterface $node) |
16 | 16 | { |
17 | - if (! $node instanceof \Twig_Node_Expression_MacroCall) { |
|
17 | + if (!$node instanceof \Twig_Node_Expression_MacroCall) { |
|
18 | 18 | throw new \LogicException(sprintf('This compiler does not support the type "%s".', get_class($node))); |
19 | 19 | } |
20 | 20 | |
21 | 21 | $argsNode = $node->getNode('arguments'); |
22 | - if (! $argsNode instanceof \Twig_Node_Expression_Array) { |
|
22 | + if (!$argsNode instanceof \Twig_Node_Expression_Array) { |
|
23 | 23 | throw new \LogicException('Did not find args node.'); |
24 | 24 | } |
25 | 25 |
@@ -93,7 +93,7 @@ |
||
93 | 93 | |
94 | 94 | private function isList(array $pairs) |
95 | 95 | { |
96 | - for ($i=0,$c=count($pairs); $i<$c; $i++) { |
|
96 | + for ($i = 0, $c = count($pairs); $i < $c; $i++) { |
|
97 | 97 | if (!$pairs[$i]['key'] instanceof \Twig_Node_Expression_Constant) { |
98 | 98 | return false; |
99 | 99 | } |