@@ -245,6 +245,11 @@ discard block |
||
| 245 | 245 | ); |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | + /** |
|
| 249 | + * @param callable $function |
|
| 250 | + * |
|
| 251 | + * @return callable |
|
| 252 | + */ |
|
| 248 | 253 | private function getFunctionEvaluator($function) { |
| 249 | 254 | if ($function === 'empty') { |
| 250 | 255 | return function ($expr) { |
@@ -259,6 +264,10 @@ discard block |
||
| 259 | 264 | return $function; |
| 260 | 265 | } |
| 261 | 266 | |
| 267 | + /** |
|
| 268 | + * @param string $name |
|
| 269 | + * @param callable $function |
|
| 270 | + */ |
|
| 262 | 271 | private function getFunctionCompiler($name, $function) { |
| 263 | 272 | $var = var_export(strtolower($name), true); |
| 264 | 273 | $fn = function ($expr) use ($var) { |
@@ -334,6 +343,9 @@ discard block |
||
| 334 | 343 | return $r; |
| 335 | 344 | } |
| 336 | 345 | |
| 346 | + /** |
|
| 347 | + * @param string $tag |
|
| 348 | + */ |
|
| 337 | 349 | protected function isComponent($tag) { |
| 338 | 350 | return !isset(static::$htmlTags[$tag]); |
| 339 | 351 | } |
@@ -748,6 +760,9 @@ discard block |
||
| 748 | 760 | } |
| 749 | 761 | } |
| 750 | 762 | |
| 763 | + /** |
|
| 764 | + * @param string $value |
|
| 765 | + */ |
|
| 751 | 766 | private function isExpression($value) { |
| 752 | 767 | return preg_match('`^{\S.*}$`', $value); |
| 753 | 768 | } |
@@ -987,6 +1002,9 @@ discard block |
||
| 987 | 1002 | return $text; |
| 988 | 1003 | } |
| 989 | 1004 | |
| 1005 | + /** |
|
| 1006 | + * @param string $text |
|
| 1007 | + */ |
|
| 990 | 1008 | protected function rtrim($text, \DOMNode $node, CompilerBuffer $out) { |
| 991 | 1009 | if ($this->inPre($node)) { |
| 992 | 1010 | return $text; |
@@ -79,6 +79,9 @@ discard block |
||
| 79 | 79 | $this->current->appendCode($php); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | + /** |
|
| 83 | + * @param integer $add |
|
| 84 | + */ |
|
| 82 | 85 | public function indent($add) { |
| 83 | 86 | $this->current->indent($add); |
| 84 | 87 | } |
@@ -87,6 +90,9 @@ discard block |
||
| 87 | 90 | $this->current->depth($add); |
| 88 | 91 | } |
| 89 | 92 | |
| 93 | + /** |
|
| 94 | + * @param string $name |
|
| 95 | + */ |
|
| 90 | 96 | public function depthName($name, $add = 0) { |
| 91 | 97 | return $this->current->depthName($name, $add); |
| 92 | 98 | } |
@@ -186,6 +192,9 @@ discard block |
||
| 186 | 192 | return $this; |
| 187 | 193 | } |
| 188 | 194 | |
| 195 | + /** |
|
| 196 | + * @param string $name |
|
| 197 | + */ |
|
| 189 | 198 | public function getNodeProp(\DOMNode $node, $name, $default = null) { |
| 190 | 199 | if (!$this->nodeProps->contains($node) || !array_key_exists($name, $this->nodeProps[$node])) { |
| 191 | 200 | return $default; |
@@ -193,6 +202,10 @@ discard block |
||
| 193 | 202 | return $this->nodeProps[$node][$name]; |
| 194 | 203 | } |
| 195 | 204 | |
| 205 | + /** |
|
| 206 | + * @param string $name |
|
| 207 | + * @param boolean $value |
|
| 208 | + */ |
|
| 196 | 209 | public function setNodeProp(\DOMNode $node = null, $name, $value) { |
| 197 | 210 | if ($node === null) { |
| 198 | 211 | return $this; |
@@ -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 | } |
@@ -39,6 +39,9 @@ |
||
| 39 | 39 | }); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | + /** |
|
| 43 | + * @param string $name |
|
| 44 | + */ |
|
| 42 | 45 | public function getFunctionCompiler($name) { |
| 43 | 46 | if (isset($this->functions[$name])) { |
| 44 | 47 | return $this->functions[$name]['compiler']; |
@@ -7,7 +7,6 @@ |
||
| 7 | 7 | |
| 8 | 8 | namespace Ebi; |
| 9 | 9 | |
| 10 | -use Symfony\Component\ExpressionLanguage\ExpressionFunction; |
|
| 11 | 10 | use Symfony\Component\ExpressionLanguage\Node\GetAttrNode; |
| 12 | 11 | |
| 13 | 12 | class ExpressionLanguage extends \Symfony\Component\ExpressionLanguage\ExpressionLanguage { |
@@ -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 | |