Completed
Pull Request — master (#457)
by Claus
02:19
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/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/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.
src/Core/Parser/Splitter.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Core/Parser/Sequencer.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.