@@ -159,7 +159,6 @@ discard block |
||
| 159 | 159 | * Convert a single ViewHelperNode into its cached representation. If the ViewHelper implements the "Compilable" facet, |
| 160 | 160 | * the ViewHelper itself is asked for its cached PHP code representation. If not, a ViewHelper is built and then invoked. |
| 161 | 161 | * |
| 162 | - * @param ViewHelperNode $node |
|
| 163 | 162 | * @return array |
| 164 | 163 | * @see convert() |
| 165 | 164 | */ |
@@ -315,7 +314,6 @@ discard block |
||
| 315 | 314 | } |
| 316 | 315 | |
| 317 | 316 | /** |
| 318 | - * @param ArrayNode $node |
|
| 319 | 317 | * @return array |
| 320 | 318 | * @see convert() |
| 321 | 319 | */ |
@@ -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; |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | /** |
| 688 | - * @param \Iterator|Position[] $sequence |
|
| 688 | + * @param \Iterator $sequence |
|
| 689 | 689 | * @param ArgumentDefinition[] $definitions |
| 690 | 690 | * @param bool $numeric |
| 691 | 691 | * @return ArrayNode |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | * be a node as such - which is only necessary if the quoted expression |
| 839 | 839 | * contains other (dynamic) values like an inline syntax. |
| 840 | 840 | * |
| 841 | - * @param \Iterator|Position[] $sequence |
|
| 841 | + * @param \Iterator $sequence |
|
| 842 | 842 | * @param int $leadingEscapes A backwards compatibility measure: when passed, this number of escapes must precede a closing quote for it to trigger node closing. |
| 843 | 843 | * @param bool $allowArray |
| 844 | 844 | * @return RootNode |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | { |
| 130 | 130 | $position = new Position($this->splitter->context, $this->splitter->index); |
| 131 | 131 | $ascii = (string) $this->source->bytes[$this->splitter->index]; |
| 132 | - $message .= ' ASCII: ' . $ascii . ': ' . $this->extractSourceDumpOfLineAtPosition($position); |
|
| 132 | + $message .= ' ASCII: ' . $ascii . ': ' . $this->extractSourceDumpOfLineAtPosition($position); |
|
| 133 | 133 | $error = new SequencingException($message, $code); |
| 134 | 134 | return $error; |
| 135 | 135 | } |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | $isArray = $allowArray; |
| 543 | 543 | $callDetected = false; |
| 544 | 544 | $potentialAccessor = $potentialAccessor ?? $captured; |
| 545 | - $text .= $this->source->source[$this->splitter->index - 1]; |
|
| 545 | + $text .= $this->source->source[$this->splitter->index - 1]; |
|
| 546 | 546 | if (isset($potentialAccessor)) { |
| 547 | 547 | $childNodeToAdd = new ObjectAccessorNode($potentialAccessor); |
| 548 | 548 | $node = isset($node) ? $node->addChildNode($childNodeToAdd) : $childNodeToAdd; //$node ?? (is_numeric($potentialAccessor) ? $potentialAccessor + 0 : new ObjectAccessorNode($potentialAccessor)); |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | $this->splitter->switch($this->contexts->inline); |
| 578 | 578 | if ($childNodeToAdd) { |
| 579 | 579 | $escapingEnabledBackup = $this->escapingEnabled; |
| 580 | - $this->escapingEnabled = (bool)$node->isChildrenEscapingEnabled(); |
|
| 580 | + $this->escapingEnabled = (bool) $node->isChildrenEscapingEnabled(); |
|
| 581 | 581 | if ($childNodeToAdd instanceof ObjectAccessorNode) { |
| 582 | 582 | $this->callInterceptor($childNodeToAdd, InterceptorInterface::INTERCEPT_OBJECTACCESSOR); |
| 583 | 583 | } |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | $node = new TextNode($text); |
| 651 | 651 | $interceptionPoint = InterceptorInterface::INTERCEPT_TEXT; |
| 652 | 652 | } |
| 653 | - } elseif ($hasPass && $this->resolver->isAliasRegistered((string)$potentialAccessor)) { |
|
| 653 | + } elseif ($hasPass && $this->resolver->isAliasRegistered((string) $potentialAccessor)) { |
|
| 654 | 654 | // Fourth priority check is for a pass to a ViewHelper alias, e.g. "{value | raw}" in which case |
| 655 | 655 | // we look for the alias used and create a ViewHelperNode with no arguments. |
| 656 | 656 | $childNodeToAdd = $node; |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | } |
| 672 | 672 | |
| 673 | 673 | $escapingEnabledBackup = $this->escapingEnabled; |
| 674 | - $this->escapingEnabled = (bool)((isset($viewHelper) && $node->isOutputEscapingEnabled()) || $escapingEnabledBackup); |
|
| 674 | + $this->escapingEnabled = (bool) ((isset($viewHelper) && $node->isOutputEscapingEnabled()) || $escapingEnabledBackup); |
|
| 675 | 675 | $this->callInterceptor($node, $interceptionPoint, $this->state); |
| 676 | 676 | $this->escapingEnabled = $escapingEnabledBackup; |
| 677 | 677 | return $node; |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | throw $this->createErrorAtPosition('Unexpected colon or equals sign, no preceding key', 1559250839); |
| 715 | 715 | } |
| 716 | 716 | if ($definitions !== null && !$numeric && !isset($definitions[$key])) { |
| 717 | - throw $this->createUnsupportedArgumentError((string)$key, $definitions); |
|
| 717 | + throw $this->createUnsupportedArgumentError((string) $key, $definitions); |
|
| 718 | 718 | } |
| 719 | 719 | break; |
| 720 | 720 | |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | } elseif (isset($captured)) { |
| 772 | 772 | $key = $key ?? ($numeric ? ++$itemCount : $captured); |
| 773 | 773 | if (!$numeric && isset($definitions) && !isset($definitions[$key])) { |
| 774 | - throw $this->createUnsupportedArgumentError((string)$key, $definitions); |
|
| 774 | + throw $this->createUnsupportedArgumentError((string) $key, $definitions); |
|
| 775 | 775 | } |
| 776 | 776 | $array[$key] = is_numeric($captured) ? $captured + 0 : new ObjectAccessorNode($captured); |
| 777 | 777 | } |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | } |
| 812 | 812 | } |
| 813 | 813 | if (!$numeric && isset($key, $definitions) && !isset($definitions[$key])) { |
| 814 | - throw $this->createUnsupportedArgumentError((string)$key, $definitions); |
|
| 814 | + throw $this->createUnsupportedArgumentError((string) $key, $definitions); |
|
| 815 | 815 | } |
| 816 | 816 | $this->escapingEnabled = $escapingEnabledBackup; |
| 817 | 817 | return new ArrayNode($array); |
@@ -6,9 +6,7 @@ |
||
| 6 | 6 | * See LICENSE.txt that was shipped with this package. |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode; |
|
| 10 | 9 | use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; |
| 11 | -use TYPO3Fluid\Fluid\Core\Variables\VariableProviderInterface; |
|
| 12 | 10 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; |
| 13 | 11 | |
| 14 | 12 | class CViewHelper extends AbstractViewHelper |
@@ -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; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $symbolLine = ''; |
| 78 | 78 | foreach ($symbols as $index => $symbol) { |
| 79 | 79 | $char = $symbol === Splitter::BYTE_BACKSLASH ? '\\' : chr($symbol); |
| 80 | - $capturedLength = strlen((string)$captures[$index]) + 1; |
|
| 80 | + $capturedLength = strlen((string) $captures[$index]) + 1; |
|
| 81 | 81 | $symbolLine .= $colors[$contexts[$index]] ?? "\033[01;0m"; |
| 82 | 82 | $symbolLine .= str_repeat(' ', max($capturedLength - 1, 0)) . $char . $spacing; |
| 83 | 83 | #echo str_repeat((string)$contexts[$index], $capturedLength > 0 ? $capturedLength : 1); |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | $nestingLine = ''; |
| 102 | 102 | foreach ($nesting as $index => $depth) { |
| 103 | - $capturedLength = strlen(str_replace(PHP_EOL, '', (string)$captures[$index])) + 1; |
|
| 104 | - $nestingLine .= str_repeat((string)$depth, ($capturedLength > 0 ? $capturedLength : 0)) . $spacing; |
|
| 103 | + $capturedLength = strlen(str_replace(PHP_EOL, '', (string) $captures[$index])) + 1; |
|
| 104 | + $nestingLine .= str_repeat((string) $depth, ($capturedLength > 0 ? $capturedLength : 0)) . $spacing; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | $this->writeLogLine($nestingLine); |
@@ -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 { |