@@ -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 @@ 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 | } |
@@ -159,7 +159,7 @@ |
||
159 | 159 | * character (byte). The secondary bit mask is costless as it is OR'ed into |
160 | 160 | * the primary bit mask. |
161 | 161 | * |
162 | - * @return \NoRewindIterator|string[]|null[] |
|
162 | + * @return \Generator |
|
163 | 163 | */ |
164 | 164 | public function createGenerator(): \Generator |
165 | 165 | { |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | { |
125 | 125 | $position = new Position($this->context, $this->index); |
126 | 126 | $ascii = (string) $this->source->bytes[$this->index]; |
127 | - $message .= ' ASCII: ' . $ascii . ': ' . $this->extractSourceDumpOfLineAtPosition($position); |
|
127 | + $message .= ' ASCII: ' . $ascii . ': ' . $this->extractSourceDumpOfLineAtPosition($position); |
|
128 | 128 | $error = new SequencingException($message, $code); |
129 | 129 | return $error; |
130 | 130 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } |
194 | 194 | } |
195 | 195 | |
196 | - public function switch(Context $context): Context |
|
196 | + public function switch (Context $context): Context |
|
197 | 197 | { |
198 | 198 | $previous = $this->context; |
199 | 199 | $this->context = $context; |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | $isArray = $allowArray; |
483 | 483 | $callDetected = false; |
484 | 484 | $potentialAccessor = $potentialAccessor ?? $captured; |
485 | - $text .= $this->source->source[$this->splitter->index - 1]; |
|
485 | + $text .= $this->source->source[$this->splitter->index - 1]; |
|
486 | 486 | if (isset($potentialAccessor)) { |
487 | 487 | $childNodeToAdd = new ObjectAccessorNode($potentialAccessor); |
488 | 488 | $node = isset($node) ? $node->addChildNode($childNodeToAdd) : $childNodeToAdd; //$node ?? (is_numeric($potentialAccessor) ? $potentialAccessor + 0 : new ObjectAccessorNode($potentialAccessor)); |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | $this->splitter->switch($this->contexts->inline); |
518 | 518 | if ($childNodeToAdd) { |
519 | 519 | $escapingEnabledBackup = $this->escapingEnabled; |
520 | - $this->escapingEnabled = (bool)$node->isChildrenEscapingEnabled(); |
|
520 | + $this->escapingEnabled = (bool) $node->isChildrenEscapingEnabled(); |
|
521 | 521 | if ($childNodeToAdd instanceof ObjectAccessorNode) { |
522 | 522 | $this->callInterceptor($childNodeToAdd, InterceptorInterface::INTERCEPT_OBJECTACCESSOR); |
523 | 523 | } |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | $node = new TextNode($text); |
591 | 591 | $interceptionPoint = InterceptorInterface::INTERCEPT_TEXT; |
592 | 592 | } |
593 | - } elseif ($hasPass && $this->resolver->isAliasRegistered((string)$potentialAccessor)) { |
|
593 | + } elseif ($hasPass && $this->resolver->isAliasRegistered((string) $potentialAccessor)) { |
|
594 | 594 | // Fourth priority check is for a pass to a ViewHelper alias, e.g. "{value | raw}" in which case |
595 | 595 | // we look for the alias used and create a ViewHelperNode with no arguments. |
596 | 596 | $childNodeToAdd = $node; |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | } |
612 | 612 | |
613 | 613 | $escapingEnabledBackup = $this->escapingEnabled; |
614 | - $this->escapingEnabled = (bool)((isset($viewHelper) && $node->isOutputEscapingEnabled()) || $escapingEnabledBackup); |
|
614 | + $this->escapingEnabled = (bool) ((isset($viewHelper) && $node->isOutputEscapingEnabled()) || $escapingEnabledBackup); |
|
615 | 615 | $this->callInterceptor($node, $interceptionPoint); |
616 | 616 | $this->escapingEnabled = $escapingEnabledBackup; |
617 | 617 | return $node; |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | throw $this->splitter->createErrorAtPosition('Unexpected colon or equals sign, no preceding key', 1559250839); |
654 | 654 | } |
655 | 655 | if ($definitions !== null && !$numeric && !isset($definitions[$key])) { |
656 | - throw $this->splitter->createUnsupportedArgumentError((string)$key, $definitions); |
|
656 | + throw $this->splitter->createUnsupportedArgumentError((string) $key, $definitions); |
|
657 | 657 | } |
658 | 658 | break; |
659 | 659 | |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | } elseif (isset($captured)) { |
711 | 711 | $key = $key ?? ($numeric ? ++$itemCount : $captured); |
712 | 712 | if (!$numeric && isset($definitions) && !isset($definitions[$key])) { |
713 | - throw $this->splitter->createUnsupportedArgumentError((string)$key, $definitions); |
|
713 | + throw $this->splitter->createUnsupportedArgumentError((string) $key, $definitions); |
|
714 | 714 | } |
715 | 715 | $array[$key] = is_numeric($captured) ? $captured + 0 : new ObjectAccessorNode($captured); |
716 | 716 | } |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | } |
751 | 751 | } |
752 | 752 | if (!$numeric && isset($key, $definitions) && !isset($definitions[$key])) { |
753 | - throw $this->splitter->createUnsupportedArgumentError((string)$key, $definitions); |
|
753 | + throw $this->splitter->createUnsupportedArgumentError((string) $key, $definitions); |
|
754 | 754 | } |
755 | 755 | $this->escapingEnabled = $escapingEnabledBackup; |
756 | 756 | return new ArrayNode($array); |