@@ -268,6 +268,11 @@ discard block |
||
268 | 268 | ); |
269 | 269 | } |
270 | 270 | |
271 | + /** |
|
272 | + * @param callable $function |
|
273 | + * |
|
274 | + * @return callable |
|
275 | + */ |
|
271 | 276 | private function getFunctionEvaluator($function) { |
272 | 277 | if ($function === 'empty') { |
273 | 278 | return function ($expr) { |
@@ -282,6 +287,10 @@ discard block |
||
282 | 287 | return $function; |
283 | 288 | } |
284 | 289 | |
290 | + /** |
|
291 | + * @param string $name |
|
292 | + * @param callable $function |
|
293 | + */ |
|
285 | 294 | private function getFunctionCompiler($name, $function) { |
286 | 295 | $var = var_export(strtolower($name), true); |
287 | 296 | $fn = function ($expr) use ($var) { |
@@ -362,6 +371,9 @@ discard block |
||
362 | 371 | return $r; |
363 | 372 | } |
364 | 373 | |
374 | + /** |
|
375 | + * @param string $tag |
|
376 | + */ |
|
365 | 377 | protected function isComponent($tag) { |
366 | 378 | return !isset(static::$htmlTags[$tag]); |
367 | 379 | } |
@@ -492,6 +504,9 @@ discard block |
||
492 | 504 | } |
493 | 505 | } |
494 | 506 | |
507 | + /** |
|
508 | + * @param string $value |
|
509 | + */ |
|
495 | 510 | protected function splitExpressions($value) { |
496 | 511 | $values = preg_split('`({\S[^}]*?})`', $value, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE); |
497 | 512 | return $values; |
@@ -844,6 +859,9 @@ discard block |
||
844 | 859 | } |
845 | 860 | } |
846 | 861 | |
862 | + /** |
|
863 | + * @param string $value |
|
864 | + */ |
|
847 | 865 | private function isExpression($value) { |
848 | 866 | return preg_match('`^{\S.*}$`', $value); |
849 | 867 | } |
@@ -1115,8 +1133,8 @@ discard block |
||
1115 | 1133 | /** |
1116 | 1134 | * Whether or not a node can be skipped for the purposes of trimming whitespace. |
1117 | 1135 | * |
1118 | - * @param DOMNode|null $node The node to test. |
|
1119 | - * @param CompilerBuffer|null $out The compiler information. |
|
1136 | + * @param DOMNode $node The node to test. |
|
1137 | + * @param CompilerBuffer $out The compiler information. |
|
1120 | 1138 | * @return bool Returns **true** if whitespace can be trimmed right up to the node or **false** otherwise. |
1121 | 1139 | */ |
1122 | 1140 | private function canSkip(\DOMNode $node, CompilerBuffer $out) { |
@@ -1252,6 +1270,9 @@ discard block |
||
1252 | 1270 | $this->compileCloseTag($node, $special, $out); |
1253 | 1271 | } |
1254 | 1272 | |
1273 | + /** |
|
1274 | + * @param string $php |
|
1275 | + */ |
|
1255 | 1276 | protected function compileEscape($php) { |
1256 | 1277 | // return 'htmlspecialchars('.$php.')'; |
1257 | 1278 | return '$this->escape('.$php.')'; |
@@ -60,6 +60,7 @@ discard block |
||
60 | 60 | * Select a specific component buffer. |
61 | 61 | * @param string $component The name of the component to select. |
62 | 62 | * @param bool $add Whether to add a new component if there is already a compile buffer with the same name. |
63 | + * @return string |
|
63 | 64 | */ |
64 | 65 | public function select($component, $add = false) { |
65 | 66 | $previous = $this->currentName; |
@@ -95,6 +96,9 @@ discard block |
||
95 | 96 | $this->current->echoLiteral($value); |
96 | 97 | } |
97 | 98 | |
99 | + /** |
|
100 | + * @param string $php |
|
101 | + */ |
|
98 | 102 | public function echoCode($php) { |
99 | 103 | $this->current->echoCode($php); |
100 | 104 | } |
@@ -103,6 +107,9 @@ discard block |
||
103 | 107 | $this->current->appendCode($php); |
104 | 108 | } |
105 | 109 | |
110 | + /** |
|
111 | + * @param integer $add |
|
112 | + */ |
|
106 | 113 | public function indent($add) { |
107 | 114 | $this->current->indent($add); |
108 | 115 | } |
@@ -111,6 +118,9 @@ discard block |
||
111 | 118 | $this->current->depth($add); |
112 | 119 | } |
113 | 120 | |
121 | + /** |
|
122 | + * @param string $name |
|
123 | + */ |
|
114 | 124 | public function depthName($name, $add = 0) { |
115 | 125 | return $this->current->depthName($name, $add); |
116 | 126 | } |
@@ -225,6 +235,9 @@ discard block |
||
225 | 235 | return $this; |
226 | 236 | } |
227 | 237 | |
238 | + /** |
|
239 | + * @param string $name |
|
240 | + */ |
|
228 | 241 | public function getNodeProp(\DOMNode $node, $name, $default = null) { |
229 | 242 | if (!$this->nodeProps->contains($node) || !array_key_exists($name, $this->nodeProps[$node])) { |
230 | 243 | return $default; |
@@ -232,6 +245,10 @@ discard block |
||
232 | 245 | return $this->nodeProps[$node][$name]; |
233 | 246 | } |
234 | 247 | |
248 | + /** |
|
249 | + * @param string $name |
|
250 | + * @param boolean $value |
|
251 | + */ |
|
235 | 252 | public function setNodeProp(\DOMNode $node = null, $name, $value) { |
236 | 253 | if ($node === null) { |
237 | 254 | return $this; |