@@ -15,7 +15,6 @@ |
||
| 15 | 15 | use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\NodeInterface; |
| 16 | 16 | use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\NumericNode; |
| 17 | 17 | use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode; |
| 18 | -use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\PostponedViewHelperNode; |
|
| 19 | 18 | use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\RootNode; |
| 20 | 19 | use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\TextNode; |
| 21 | 20 | use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode; |
@@ -313,7 +313,6 @@ |
||
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | /** |
| 316 | - * @param ArrayNode $node |
|
| 317 | 316 | * @return array |
| 318 | 317 | * @see convert() |
| 319 | 318 | */ |
@@ -200,7 +200,7 @@ |
||
| 200 | 200 | && $argumentsObjectTree[$argumentName] !== null) { |
| 201 | 201 | $argumentsObjectTree[$argumentName] = new BooleanNode($argumentsObjectTree[$argumentName]); |
| 202 | 202 | } else { |
| 203 | - $argumentsObjectTree[$argumentName] = (bool)$argumentsObjectTree[$argumentName]; |
|
| 203 | + $argumentsObjectTree[$argumentName] = (bool) $argumentsObjectTree[$argumentName]; |
|
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | } |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | public const CONTEXT_ROOT = 0; |
| 9 | 9 | public const CONTEXT_INLINE = 1; |
| 10 | 10 | public const CONTEXT_TAG = 2; |
| 11 | - public const CONTEXT_ARRAY= 3; |
|
| 11 | + public const CONTEXT_ARRAY = 3; |
|
| 12 | 12 | public const CONTEXT_QUOTED = 4; |
| 13 | 13 | public const CONTEXT_ATTRIBUTES = 5; |
| 14 | 14 | public const CONTEXT_DEAD = 6; |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | { |
| 49 | 49 | $previous = $this->features[$feature]; |
| 50 | 50 | if (is_bool($state) || is_numeric($state) || is_null($state)) { |
| 51 | - $this->features[$feature] = (bool)$state; |
|
| 51 | + $this->features[$feature] = (bool) $state; |
|
| 52 | 52 | } elseif (is_string($state)) { |
| 53 | 53 | $this->features[$feature] = in_array(strtolower($state), ['on', 'true', 'enabled']); |
| 54 | 54 | } |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - public function switch(Context $context): Context |
|
| 126 | + public function switch (Context $context): Context |
|
| 127 | 127 | { |
| 128 | 128 | $previous = $this->context; |
| 129 | 129 | $this->context = $context; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | protected static function evaluateCondition($arguments = null) |
| 125 | 125 | { |
| 126 | - return isset($arguments['condition']) && (bool)($arguments['condition']); |
|
| 126 | + return isset($arguments['condition']) && (bool) ($arguments['condition']); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | if ($condition instanceof NodeInterface) { |
| 210 | 210 | $condition = $condition->evaluate($this->renderingContext); |
| 211 | 211 | } |
| 212 | - if ((bool)$condition === true) { |
|
| 212 | + if ((bool) $condition === true) { |
|
| 213 | 213 | return $childNode->evaluate($this->renderingContext); |
| 214 | 214 | } |
| 215 | 215 | } else { |
@@ -186,7 +186,7 @@ |
||
| 186 | 186 | $argument = $definition->getDefaultValue(); |
| 187 | 187 | } elseif (($type = $definition->getType()) && ($type === 'bool' || $type === 'boolean')) { |
| 188 | 188 | // Cast the value or create a BooleanNode |
| 189 | - $argument = is_bool($argument) || is_numeric($argument) ? (bool)$argument : new BooleanNode($argument); |
|
| 189 | + $argument = is_bool($argument) || is_numeric($argument) ? (bool) $argument : new BooleanNode($argument); |
|
| 190 | 190 | } |
| 191 | 191 | $arguments[$name] = $argument; |
| 192 | 192 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | /** |
| 200 | - * @param \Iterator|string[]|null[] $sequence |
|
| 200 | + * @param \Iterator $sequence |
|
| 201 | 201 | * @return NodeInterface|null |
| 202 | 202 | */ |
| 203 | 203 | protected function sequenceTagNode(\Iterator $sequence): ?NodeInterface |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | /** |
| 370 | - * @param \Iterator|string[]|null[] $sequence |
|
| 370 | + * @param \Iterator $sequence |
|
| 371 | 371 | * @param bool $allowArray |
| 372 | 372 | * @return NodeInterface |
| 373 | 373 | */ |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 | /** |
| 685 | - * @param \Iterator|string[]|null[] $sequence |
|
| 685 | + * @param \Iterator $sequence |
|
| 686 | 686 | * @param ArgumentDefinition[] $definitions |
| 687 | 687 | * @param bool $numeric |
| 688 | 688 | * @return ArrayNode |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | * be a node as such - which is only necessary if the quoted expression |
| 836 | 836 | * contains other (dynamic) values like an inline syntax. |
| 837 | 837 | * |
| 838 | - * @param \Iterator|string[]|null[] $sequence |
|
| 838 | + * @param \Iterator $sequence |
|
| 839 | 839 | * @param int $leadingEscapes A backwards compatibility measure: when passed, this number of escapes must precede a closing quote for it to trigger node closing. |
| 840 | 840 | * @param bool $allowArray |
| 841 | 841 | * @return RootNode |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | { |
| 127 | 127 | $position = new Position($this->splitter->context, $this->splitter->index); |
| 128 | 128 | $ascii = (string) $this->source->bytes[$this->splitter->index]; |
| 129 | - $message .= ' ASCII: ' . $ascii . ': ' . $this->extractSourceDumpOfLineAtPosition($position); |
|
| 129 | + $message .= ' ASCII: ' . $ascii . ': ' . $this->extractSourceDumpOfLineAtPosition($position); |
|
| 130 | 130 | $error = new SequencingException($message, $code); |
| 131 | 131 | return $error; |
| 132 | 132 | } |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | $isArray = $allowArray; |
| 540 | 540 | $callDetected = false; |
| 541 | 541 | $potentialAccessor = $potentialAccessor ?? $captured; |
| 542 | - $text .= $this->source->source[$this->splitter->index - 1]; |
|
| 542 | + $text .= $this->source->source[$this->splitter->index - 1]; |
|
| 543 | 543 | if (isset($potentialAccessor)) { |
| 544 | 544 | $childNodeToAdd = new ObjectAccessorNode($potentialAccessor); |
| 545 | 545 | $node = isset($node) ? $node->addChildNode($childNodeToAdd) : $childNodeToAdd; //$node ?? (is_numeric($potentialAccessor) ? $potentialAccessor + 0 : new ObjectAccessorNode($potentialAccessor)); |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | $this->splitter->switch($this->contexts->inline); |
| 575 | 575 | if ($childNodeToAdd) { |
| 576 | 576 | $escapingEnabledBackup = $this->escapingEnabled; |
| 577 | - $this->escapingEnabled = (bool)$node->isChildrenEscapingEnabled(); |
|
| 577 | + $this->escapingEnabled = (bool) $node->isChildrenEscapingEnabled(); |
|
| 578 | 578 | if ($childNodeToAdd instanceof ObjectAccessorNode) { |
| 579 | 579 | $this->callInterceptor($childNodeToAdd, InterceptorInterface::INTERCEPT_OBJECTACCESSOR); |
| 580 | 580 | } |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | $node = new TextNode($text); |
| 648 | 648 | $interceptionPoint = InterceptorInterface::INTERCEPT_TEXT; |
| 649 | 649 | } |
| 650 | - } elseif ($hasPass && $this->resolver->isAliasRegistered((string)$potentialAccessor)) { |
|
| 650 | + } elseif ($hasPass && $this->resolver->isAliasRegistered((string) $potentialAccessor)) { |
|
| 651 | 651 | // Fourth priority check is for a pass to a ViewHelper alias, e.g. "{value | raw}" in which case |
| 652 | 652 | // we look for the alias used and create a ViewHelperNode with no arguments. |
| 653 | 653 | $childNodeToAdd = $node; |
@@ -668,7 +668,7 @@ discard block |
||
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 | $escapingEnabledBackup = $this->escapingEnabled; |
| 671 | - $this->escapingEnabled = (bool)((isset($viewHelper) && $node->isOutputEscapingEnabled()) || $escapingEnabledBackup); |
|
| 671 | + $this->escapingEnabled = (bool) ((isset($viewHelper) && $node->isOutputEscapingEnabled()) || $escapingEnabledBackup); |
|
| 672 | 672 | $this->callInterceptor($node, $interceptionPoint); |
| 673 | 673 | $this->escapingEnabled = $escapingEnabledBackup; |
| 674 | 674 | return $node; |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | throw $this->createErrorAtPosition('Unexpected colon or equals sign, no preceding key', 1559250839); |
| 712 | 712 | } |
| 713 | 713 | if ($definitions !== null && !$numeric && !isset($definitions[$key])) { |
| 714 | - throw $this->createUnsupportedArgumentError((string)$key, $definitions); |
|
| 714 | + throw $this->createUnsupportedArgumentError((string) $key, $definitions); |
|
| 715 | 715 | } |
| 716 | 716 | break; |
| 717 | 717 | |
@@ -768,7 +768,7 @@ discard block |
||
| 768 | 768 | } elseif (isset($captured)) { |
| 769 | 769 | $key = $key ?? ($numeric ? ++$itemCount : $captured); |
| 770 | 770 | if (!$numeric && isset($definitions) && !isset($definitions[$key])) { |
| 771 | - throw $this->createUnsupportedArgumentError((string)$key, $definitions); |
|
| 771 | + throw $this->createUnsupportedArgumentError((string) $key, $definitions); |
|
| 772 | 772 | } |
| 773 | 773 | $array[$key] = is_numeric($captured) ? $captured + 0 : new ObjectAccessorNode($captured); |
| 774 | 774 | } |
@@ -808,7 +808,7 @@ discard block |
||
| 808 | 808 | } |
| 809 | 809 | } |
| 810 | 810 | if (!$numeric && isset($key, $definitions) && !isset($definitions[$key])) { |
| 811 | - throw $this->createUnsupportedArgumentError((string)$key, $definitions); |
|
| 811 | + throw $this->createUnsupportedArgumentError((string) $key, $definitions); |
|
| 812 | 812 | } |
| 813 | 813 | $this->escapingEnabled = $escapingEnabledBackup; |
| 814 | 814 | return new ArrayNode($array); |