Completed
Pull Request — master (#457)
by Claus
02:13
created
src/Core/Compiler/NodeConverter.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -313,7 +313,6 @@
 block discarded – undo
313 313
     }
314 314
 
315 315
     /**
316
-     * @param ArrayNode $node
317 316
      * @return array
318 317
      * @see convert()
319 318
      */
Please login to merge, or discard this patch.
src/Core/Parser/Sequencer.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Core/Parser/SyntaxTree/ViewHelperNode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Core/Parser/Context.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Core/Parser/Configuration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Core/Parser/Splitter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Core/ViewHelper/AbstractConditionViewHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 {
Please login to merge, or discard this patch.
src/Core/ViewHelper/AbstractViewHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.