@@ -27,12 +27,21 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function compile(); |
| 29 | 29 | |
| 30 | + /** |
|
| 31 | + * @return boolean |
|
| 32 | + */ |
|
| 30 | 33 | public function needsEnvironment(); |
| 31 | 34 | |
| 35 | + /** |
|
| 36 | + * @return boolean |
|
| 37 | + */ |
|
| 32 | 38 | public function needsContext(); |
| 33 | 39 | |
| 34 | 40 | public function getSafe(Twig_Node $filterArgs); |
| 35 | 41 | |
| 42 | + /** |
|
| 43 | + * @return void |
|
| 44 | + */ |
|
| 36 | 45 | public function setArguments($arguments); |
| 37 | 46 | |
| 38 | 47 | public function getArguments(); |
@@ -390,6 +390,9 @@ |
||
| 390 | 390 | return '/'.implode('|', $regex).'/A'; |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | + /** |
|
| 394 | + * @param integer $state |
|
| 395 | + */ |
|
| 393 | 396 | protected function pushState($state) |
| 394 | 397 | { |
| 395 | 398 | $this->states[] = $this->state; |
@@ -166,6 +166,11 @@ discard block |
||
| 166 | 166 | return filemtime($this->findTemplate($name)) <= $time; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | + /** |
|
| 170 | + * @param string $name |
|
| 171 | + * |
|
| 172 | + * @return string |
|
| 173 | + */ |
|
| 169 | 174 | protected function findTemplate($name) |
| 170 | 175 | { |
| 171 | 176 | $name = $this->normalizeName($name); |
@@ -194,6 +199,9 @@ discard block |
||
| 194 | 199 | throw new Twig_Error_Loader(sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths[$namespace]))); |
| 195 | 200 | } |
| 196 | 201 | |
| 202 | + /** |
|
| 203 | + * @param string $name |
|
| 204 | + */ |
|
| 197 | 205 | protected function parseName($name, $default = self::MAIN_NAMESPACE) |
| 198 | 206 | { |
| 199 | 207 | if (isset($name[0]) && '@' == $name[0]) { |
@@ -215,6 +223,9 @@ discard block |
||
| 215 | 223 | return preg_replace('#/{2,}#', '/', strtr((string) $name, '\\', '/')); |
| 216 | 224 | } |
| 217 | 225 | |
| 226 | + /** |
|
| 227 | + * @param string $name |
|
| 228 | + */ |
|
| 218 | 229 | protected function validateName($name) |
| 219 | 230 | { |
| 220 | 231 | if (false !== strpos($name, "\0")) { |
@@ -123,6 +123,7 @@ discard block |
||
| 123 | 123 | * Returns true if the attribute is defined. |
| 124 | 124 | * |
| 125 | 125 | * @param string The attribute name |
| 126 | + * @param string $name |
|
| 126 | 127 | * |
| 127 | 128 | * @return bool true if the attribute is defined, false otherwise |
| 128 | 129 | */ |
@@ -135,6 +136,7 @@ discard block |
||
| 135 | 136 | * Gets an attribute. |
| 136 | 137 | * |
| 137 | 138 | * @param string The attribute name |
| 139 | + * @param string $name |
|
| 138 | 140 | * |
| 139 | 141 | * @return mixed The attribute value |
| 140 | 142 | */ |
@@ -152,6 +154,7 @@ discard block |
||
| 152 | 154 | * |
| 153 | 155 | * @param string The attribute name |
| 154 | 156 | * @param mixed The attribute value |
| 157 | + * @param string $name |
|
| 155 | 158 | */ |
| 156 | 159 | public function setAttribute($name, $value) |
| 157 | 160 | { |
@@ -201,6 +204,7 @@ discard block |
||
| 201 | 204 | * |
| 202 | 205 | * @param string The node name |
| 203 | 206 | * @param Twig_Node A Twig_Node instance |
| 207 | + * @param string $name |
|
| 204 | 208 | */ |
| 205 | 209 | public function setNode($name, $node = null) |
| 206 | 210 | { |
@@ -21,6 +21,9 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | class Twig_Node_SandboxedPrint extends Twig_Node_Print |
| 23 | 23 | { |
| 24 | + /** |
|
| 25 | + * @param integer $lineno |
|
| 26 | + */ |
|
| 24 | 27 | public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) |
| 25 | 28 | { |
| 26 | 29 | parent::__construct($expr, $lineno, $tag); |
@@ -22,10 +22,17 @@ |
||
| 22 | 22 | * Compiles the node to PHP. |
| 23 | 23 | * |
| 24 | 24 | * @param Twig_Compiler $compiler A Twig_Compiler instance |
| 25 | + * @return void |
|
| 25 | 26 | */ |
| 26 | 27 | public function compile(Twig_Compiler $compiler); |
| 27 | 28 | |
| 29 | + /** |
|
| 30 | + * @return integer |
|
| 31 | + */ |
|
| 28 | 32 | public function getLine(); |
| 29 | 33 | |
| 34 | + /** |
|
| 35 | + * @return string|null |
|
| 36 | + */ |
|
| 30 | 37 | public function getNodeTag(); |
| 31 | 38 | } |
@@ -121,6 +121,9 @@ |
||
| 121 | 121 | return $filter; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | + /** |
|
| 125 | + * @param Twig_Environment $env |
|
| 126 | + */ |
|
| 124 | 127 | protected function isSafeFor($type, Twig_NodeInterface $expression, $env) |
| 125 | 128 | { |
| 126 | 129 | $safe = $this->safeAnalysis->getSafe($expression); |
@@ -227,21 +227,33 @@ discard block |
||
| 227 | 227 | array_pop($this->blockStack); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | + /** |
|
| 231 | + * @param string $name |
|
| 232 | + */ |
|
| 230 | 233 | public function pushBlockStack($name) |
| 231 | 234 | { |
| 232 | 235 | $this->blockStack[] = $name; |
| 233 | 236 | } |
| 234 | 237 | |
| 238 | + /** |
|
| 239 | + * @param string $name |
|
| 240 | + */ |
|
| 235 | 241 | public function hasBlock($name) |
| 236 | 242 | { |
| 237 | 243 | return isset($this->blocks[$name]); |
| 238 | 244 | } |
| 239 | 245 | |
| 246 | + /** |
|
| 247 | + * @param string $name |
|
| 248 | + */ |
|
| 240 | 249 | public function getBlock($name) |
| 241 | 250 | { |
| 242 | 251 | return $this->blocks[$name]; |
| 243 | 252 | } |
| 244 | 253 | |
| 254 | + /** |
|
| 255 | + * @param string $name |
|
| 256 | + */ |
|
| 245 | 257 | public function setBlock($name, Twig_Node_Block $value) |
| 246 | 258 | { |
| 247 | 259 | $this->blocks[$name] = new Twig_Node_Body(array($value), array(), $value->getLine()); |
@@ -252,6 +264,9 @@ discard block |
||
| 252 | 264 | return isset($this->macros[$name]); |
| 253 | 265 | } |
| 254 | 266 | |
| 267 | + /** |
|
| 268 | + * @param string $name |
|
| 269 | + */ |
|
| 255 | 270 | public function setMacro($name, Twig_Node_Macro $node) |
| 256 | 271 | { |
| 257 | 272 | if (null === $this->reservedMacroNames) { |
@@ -269,6 +284,9 @@ discard block |
||
| 269 | 284 | $this->macros[$name] = $node; |
| 270 | 285 | } |
| 271 | 286 | |
| 287 | + /** |
|
| 288 | + * @param Twig_Node $trait |
|
| 289 | + */ |
|
| 272 | 290 | public function addTrait($trait) |
| 273 | 291 | { |
| 274 | 292 | $this->traits[] = $trait; |
@@ -286,11 +304,18 @@ discard block |
||
| 286 | 304 | $this->embeddedTemplates[] = $template; |
| 287 | 305 | } |
| 288 | 306 | |
| 307 | + /** |
|
| 308 | + * @param string $type |
|
| 309 | + * @param string $name |
|
| 310 | + */ |
|
| 289 | 311 | public function addImportedSymbol($type, $alias, $name = null, Twig_Node_Expression $node = null) |
| 290 | 312 | { |
| 291 | 313 | $this->importedSymbols[0][$type][$alias] = array('name' => $name, 'node' => $node); |
| 292 | 314 | } |
| 293 | 315 | |
| 316 | + /** |
|
| 317 | + * @param string $type |
|
| 318 | + */ |
|
| 294 | 319 | public function getImportedSymbol($type, $alias) |
| 295 | 320 | { |
| 296 | 321 | foreach ($this->importedSymbols as $functions) { |
@@ -36,6 +36,9 @@ discard block |
||
| 36 | 36 | return $str; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | + /** |
|
| 40 | + * @param string $parent |
|
| 41 | + */ |
|
| 39 | 42 | private function dumpChildren($parent, Twig_Profiler_Profile $profile, &$data) |
| 40 | 43 | { |
| 41 | 44 | foreach ($profile as $p) { |
@@ -49,6 +52,9 @@ discard block |
||
| 49 | 52 | } |
| 50 | 53 | } |
| 51 | 54 | |
| 55 | + /** |
|
| 56 | + * @param string $edge |
|
| 57 | + */ |
|
| 52 | 58 | private function dumpProfile($edge, Twig_Profiler_Profile $profile, &$data) |
| 53 | 59 | { |
| 54 | 60 | if (isset($data[$edge])) { |