@@ -50,6 +50,9 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | + /** |
|
| 54 | + * @param boolean $append |
|
| 55 | + */ |
|
| 53 | 56 | private function ensureEcho($append) { |
| 54 | 57 | if (!$this->inEcho) { |
| 55 | 58 | $this->buffer .= $this->px().'echo '; |
@@ -137,7 +140,7 @@ discard block |
||
| 137 | 140 | /** |
| 138 | 141 | * Get the depth. |
| 139 | 142 | * |
| 140 | - * @return mixed Returns the depth. |
|
| 143 | + * @return integer Returns the depth. |
|
| 141 | 144 | */ |
| 142 | 145 | public function getDepth() { |
| 143 | 146 | return $this->depth; |
@@ -90,6 +90,11 @@ |
||
| 90 | 90 | $this->compiler->defineFunction($name, $function); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | + /** |
|
| 94 | + * @param string $func |
|
| 95 | + * |
|
| 96 | + * @return callable|null |
|
| 97 | + */ |
|
| 93 | 98 | private function mb($func) { |
| 94 | 99 | return function_exists("mb_$func") ? "mb_$func" : $func; |
| 95 | 100 | } |
@@ -50,6 +50,9 @@ |
||
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | + /** |
|
| 54 | + * @param string $component |
|
| 55 | + */ |
|
| 53 | 56 | private function componentPath($component, $full = true) { |
| 54 | 57 | $subpath = str_replace('.', DIRECTORY_SEPARATOR, $component); |
| 55 | 58 | |
@@ -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 (...$args) 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 | } |
@@ -1130,8 +1148,8 @@ discard block |
||
| 1130 | 1148 | /** |
| 1131 | 1149 | * Whether or not a node can be skipped for the purposes of trimming whitespace. |
| 1132 | 1150 | * |
| 1133 | - * @param DOMNode|null $node The node to test. |
|
| 1134 | - * @param CompilerBuffer|null $out The compiler information. |
|
| 1151 | + * @param DOMNode $node The node to test. |
|
| 1152 | + * @param CompilerBuffer $out The compiler information. |
|
| 1135 | 1153 | * @return bool Returns **true** if whitespace can be trimmed right up to the node or **false** otherwise. |
| 1136 | 1154 | */ |
| 1137 | 1155 | private function canSkip(\DOMNode $node, CompilerBuffer $out) { |
@@ -1297,6 +1315,9 @@ discard block |
||
| 1297 | 1315 | $this->compileCloseTag($node, $special, $out); |
| 1298 | 1316 | } |
| 1299 | 1317 | |
| 1318 | + /** |
|
| 1319 | + * @param string $php |
|
| 1320 | + */ |
|
| 1300 | 1321 | protected function compileEscape($php) { |
| 1301 | 1322 | // return 'htmlspecialchars('.$php.')'; |
| 1302 | 1323 | return '$this->escape('.$php.')'; |
@@ -74,6 +74,9 @@ |
||
| 74 | 74 | return "\${$field}{$i}"; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | + /** |
|
| 78 | + * @param string $name |
|
| 79 | + */ |
|
| 77 | 80 | public function getFunctionCompiler($name) { |
| 78 | 81 | if (isset($this->functions[$name])) { |
| 79 | 82 | return $this->functions[$name]['compiler']; |
@@ -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; |
@@ -103,6 +104,9 @@ discard block |
||
| 103 | 104 | $this->current->appendCode($php); |
| 104 | 105 | } |
| 105 | 106 | |
| 107 | + /** |
|
| 108 | + * @param integer $add |
|
| 109 | + */ |
|
| 106 | 110 | public function indent($add) { |
| 107 | 111 | $this->current->indent($add); |
| 108 | 112 | } |
@@ -111,6 +115,9 @@ discard block |
||
| 111 | 115 | $this->current->depth($add); |
| 112 | 116 | } |
| 113 | 117 | |
| 118 | + /** |
|
| 119 | + * @param string $name |
|
| 120 | + */ |
|
| 114 | 121 | public function depthName($name, $add = 0) { |
| 115 | 122 | return $this->current->depthName($name, $add); |
| 116 | 123 | } |
@@ -225,6 +232,9 @@ discard block |
||
| 225 | 232 | return $this; |
| 226 | 233 | } |
| 227 | 234 | |
| 235 | + /** |
|
| 236 | + * @param string $name |
|
| 237 | + */ |
|
| 228 | 238 | public function getNodeProp(\DOMNode $node, $name, $default = null) { |
| 229 | 239 | if (!$this->nodeProps->contains($node) || !array_key_exists($name, $this->nodeProps[$node])) { |
| 230 | 240 | return $default; |
@@ -232,6 +242,9 @@ discard block |
||
| 232 | 242 | return $this->nodeProps[$node][$name]; |
| 233 | 243 | } |
| 234 | 244 | |
| 245 | + /** |
|
| 246 | + * @param string $name |
|
| 247 | + */ |
|
| 235 | 248 | public function setNodeProp(\DOMNode $node = null, $name, $value) { |
| 236 | 249 | if ($node === null) { |
| 237 | 250 | return $this; |