Completed
Pull Request — master (#457)
by Claus
02:40
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
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
                     $isArray = $allowArray;
484 484
                     $callDetected = false;
485 485
                     $potentialAccessor = $potentialAccessor ?? $captured;
486
-                    $text .=  $this->source->source[$this->splitter->index - 1];
486
+                    $text .= $this->source->source[$this->splitter->index - 1];
487 487
                     if ($node instanceof ViewHelperInterface) {
488 488
                         $node->postParse($arguments, $this->state, $this->renderingContext);
489 489
                     }
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
                     $this->splitter->switch($this->contexts->inline);
522 522
                     if ($childNodeToAdd) {
523 523
                         $escapingEnabledBackup = $this->escapingEnabled;
524
-                        $this->escapingEnabled = (bool)$node->isChildrenEscapingEnabled();
524
+                        $this->escapingEnabled = (bool) $node->isChildrenEscapingEnabled();
525 525
                         if ($childNodeToAdd instanceof ObjectAccessorNode) {
526 526
                             $this->callInterceptor($childNodeToAdd, InterceptorInterface::INTERCEPT_OBJECTACCESSOR);
527 527
                         }
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
                             $node = new TextNode($text);
595 595
                             $interceptionPoint = InterceptorInterface::INTERCEPT_TEXT;
596 596
                         }
597
-                    } elseif ($hasPass && $this->resolver->isAliasRegistered((string)$potentialAccessor)) {
597
+                    } elseif ($hasPass && $this->resolver->isAliasRegistered((string) $potentialAccessor)) {
598 598
                         // Fourth priority check is for a pass to a ViewHelper alias, e.g. "{value | raw}" in which case
599 599
                         // we look for the alias used and create a ViewHelperNode with no arguments.
600 600
                         $childNodeToAdd = $node;
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
                     }
616 616
 
617 617
                     $escapingEnabledBackup = $this->escapingEnabled;
618
-                    $this->escapingEnabled = (bool)((isset($viewHelper) && $node->isOutputEscapingEnabled()) || $escapingEnabledBackup);
618
+                    $this->escapingEnabled = (bool) ((isset($viewHelper) && $node->isOutputEscapingEnabled()) || $escapingEnabledBackup);
619 619
                     $this->callInterceptor($node, $interceptionPoint);
620 620
                     $this->escapingEnabled = $escapingEnabledBackup;
621 621
                     return $node;
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
                         throw $this->splitter->createErrorAtPosition('Unexpected colon or equals sign, no preceding key', 1559250839);
658 658
                     }
659 659
                     if ($definitions !== null && !$numeric && !isset($definitions[$key])) {
660
-                        throw $this->splitter->createUnsupportedArgumentError((string)$key, $definitions);
660
+                        throw $this->splitter->createUnsupportedArgumentError((string) $key, $definitions);
661 661
                     }
662 662
                     break;
663 663
 
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
                     } elseif (isset($captured)) {
715 715
                         $key = $key ?? ($numeric ? ++$itemCount : $captured);
716 716
                         if (!$numeric && isset($definitions) && !isset($definitions[$key])) {
717
-                            throw $this->splitter->createUnsupportedArgumentError((string)$key, $definitions);
717
+                            throw $this->splitter->createUnsupportedArgumentError((string) $key, $definitions);
718 718
                         }
719 719
                         $array[$key] = is_numeric($captured) ? $captured + 0 : new ObjectAccessorNode($captured);
720 720
                     }
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
                         }
755 755
                     }
756 756
                     if (!$numeric && isset($key, $definitions) && !isset($definitions[$key])) {
757
-                        throw $this->splitter->createUnsupportedArgumentError((string)$key, $definitions);
757
+                        throw $this->splitter->createUnsupportedArgumentError((string) $key, $definitions);
758 758
                     }
759 759
                     $this->escapingEnabled = $escapingEnabledBackup;
760 760
                     return new ArrayNode($array);
Please login to merge, or discard this patch.