diff --git a/composer.json b/composer.json index d71d7698f..334b7a32c 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, "require-dev": { "ext-json": "*", - "friendsofphp/php-cs-fixer": "^3.52.1", + "friendsofphp/php-cs-fixer": "^3.54.0", "phpstan/phpstan": "^1.10.14", "phpstan/phpstan-phpunit": "^1.3.11", "phpunit/phpunit": "^10.2.6" diff --git a/examples/example_conditions.php b/examples/example_conditions.php index 6600a2610..7072861f4 100644 --- a/examples/example_conditions.php +++ b/examples/example_conditions.php @@ -34,8 +34,8 @@ 'nested' => [ 'then' => 'Dotted variable TRUE', 'else' => 'Dotted variable FALSE', - 'check' => true - ] + 'check' => true, + ], ]); // Assigning the template path and filename to be rendered. Doing this overrides diff --git a/examples/example_multiplepaths.php b/examples/example_multiplepaths.php index b7a042bef..365e7871c 100644 --- a/examples/example_multiplepaths.php +++ b/examples/example_multiplepaths.php @@ -49,7 +49,7 @@ TemplatePaths::CONFIG_PARTIALROOTPATHS => [ __DIR__ . '/Resources/Private/Partials/', __DIR__ . '/ResourceOverrides/Private/Partials/', - ] + ], ]); $view->assign('foobar', 'This is foobar'); diff --git a/examples/example_structures.php b/examples/example_structures.php index ae6b6be62..faa35d1eb 100644 --- a/examples/example_structures.php +++ b/examples/example_structures.php @@ -35,7 +35,7 @@ $view->assign('group', [ ['property' => 'one'], ['property' => 'one'], - ['property' => 'two'] + ['property' => 'two'], ]); // Rendering the View: plain old rendering of single file, no bells and whistles. diff --git a/examples/example_variables.php b/examples/example_variables.php index 76a8f30ee..8cca4f579 100644 --- a/examples/example_variables.php +++ b/examples/example_variables.php @@ -33,7 +33,7 @@ 'csv' => 'one,two', 'aStringWithNumbers' => '132 a string', 'anArray' => ['one', 'two'], - 'typeNameInteger' => 'integer' + 'typeNameInteger' => 'integer', ], 'foobar' => 'string foo', // The variables we will use as dynamic part names: @@ -48,14 +48,14 @@ // A numerically indexed array which we will access directly. 'numeric' => [ 'foo', - 'bar' + 'bar', ], $dynamic1 => 'Dynamic key in $array[$dynamic1]', $dynamic2 => 'Dynamic key in $array[$dynamic2]', ], '123numericprefix' => 'Numeric prefixed variable', // A variable whose value refers to another variable name - 'dynamicVariableName' => 'foobar' + 'dynamicVariableName' => 'foobar', ]); // Assigning the template path and filename to be rendered. Doing this overrides diff --git a/examples/src/CustomViewHelperResolver.php b/examples/src/CustomViewHelperResolver.php index 6132a495e..4b3405e02 100644 --- a/examples/src/CustomViewHelperResolver.php +++ b/examples/src/CustomViewHelperResolver.php @@ -55,7 +55,7 @@ public function getArgumentDefinitionsForViewHelper(ViewHelperInterface $viewHel 'array', // our argument must now be an array 'This is our new description for the argument', false, // argument is no longer mandatory - ['foo' => 'bar'] // our argument has a new default value if argument is not provided + ['foo' => 'bar'], // our argument has a new default value if argument is not provided ); } return $arguments; diff --git a/examples/src/Helper/ExampleHelper.php b/examples/src/Helper/ExampleHelper.php index b558abba9..5951e6072 100644 --- a/examples/src/Helper/ExampleHelper.php +++ b/examples/src/Helper/ExampleHelper.php @@ -31,13 +31,13 @@ public function init(): TemplateView // rendering the file located in `TemplatesB` because this folder was last // and is checked first (think of these paths as prioritised fallbacks). $paths->setTemplateRootPaths([ - __DIR__ . '/../../Resources/Private/Templates/' + __DIR__ . '/../../Resources/Private/Templates/', ]); $paths->setLayoutRootPaths([ - __DIR__ . '/../../Resources/Private/Layouts/' + __DIR__ . '/../../Resources/Private/Layouts/', ]); $paths->setPartialRootPaths([ - __DIR__ . '/../../Resources/Private/Partials/' + __DIR__ . '/../../Resources/Private/Partials/', ]); // Configure View's caching to use system temp dir (typically /tmp und unix) as caching directory. diff --git a/src/Core/Cache/FluidCacheWarmupResult.php b/src/Core/Cache/FluidCacheWarmupResult.php index 327577e18..c6cc162c9 100644 --- a/src/Core/Cache/FluidCacheWarmupResult.php +++ b/src/Core/Cache/FluidCacheWarmupResult.php @@ -60,7 +60,7 @@ public function add(ParsedTemplateInterface $state, $templatePathAndFilename) static::RESULT_COMPILABLE => $currentlyCompiled || $state->isCompilable(), static::RESULT_COMPILED => $currentlyCompiled, static::RESULT_HASLAYOUT => $state->hasLayout(), - static::RESULT_COMPILEDCLASS => $state->getIdentifier() + static::RESULT_COMPILEDCLASS => $state->getIdentifier(), ]; if ($state instanceof FailedCompilingState) { $this->results[$templatePathAndFilename][static::RESULT_FAILURE] = $state->getFailureReason(); diff --git a/src/Core/Cache/StandardCacheWarmer.php b/src/Core/Cache/StandardCacheWarmer.php index ef5d3183d..131c9146d 100644 --- a/src/Core/Cache/StandardCacheWarmer.php +++ b/src/Core/Cache/StandardCacheWarmer.php @@ -76,7 +76,7 @@ public function warm(RenderingContextInterface $renderingContext) $result->merge( $this->warmupTemplateRootPaths($renderingContext), $this->warmupPartialRootPaths($renderingContext), - $this->warmupLayoutRootPaths($renderingContext) + $this->warmupLayoutRootPaths($renderingContext), ); return $result; } @@ -121,9 +121,9 @@ protected function warmupTemplateRootPaths(RenderingContextInterface $renderingC $templateFile, $paths->getTemplateIdentifier( $controllerName, - substr($templateFile, $pathCutoffPoint, $formatCutoffPoint) + substr($templateFile, $pathCutoffPoint, $formatCutoffPoint), ), - $renderingContext + $renderingContext, ); $result->add($state, $templateFile); } @@ -135,9 +135,9 @@ protected function warmupTemplateRootPaths(RenderingContextInterface $renderingC $templateFile, $paths->getTemplateIdentifier( 'Default', - substr($templateFile, $pathCutoffPoint, $formatCutoffPoint) + substr($templateFile, $pathCutoffPoint, $formatCutoffPoint), ), - $renderingContext + $renderingContext, ); $result->add($state, $templateFile); } @@ -174,7 +174,7 @@ protected function warmupPartialRootPaths(RenderingContextInterface $renderingCo $state = $this->warmSingleFile( $partialFile, $paths->getPartialIdentifier(substr($partialFile, $pathCutoffPoint, $formatCutoffPoint)), - $renderingContext + $renderingContext, ); $result->add($state, $partialFile); } @@ -211,7 +211,7 @@ protected function warmupLayoutRootPaths(RenderingContextInterface $renderingCon $state = $this->warmSingleFile( $layoutFile, $paths->getLayoutIdentifier(substr($layoutFile, $pathCutoffPoint, $formatCutoffPoint)), - $renderingContext + $renderingContext, ); $result->add($state, $layoutFile); } @@ -264,18 +264,18 @@ protected function warmSingleFile($templatePathAndFilename, $identifier, Renderi try { $parsedTemplate = $renderingContext->getTemplateParser()->getOrParseAndStoreTemplate( $identifier, - $this->createClosure($templatePathAndFilename) + $this->createClosure($templatePathAndFilename), ); } catch (StopCompilingException $error) { $parsedTemplate->setFailureReason(sprintf('Compiling is intentionally disabled. Specific reason unknown. Message: "%s"', $error->getMessage())); $parsedTemplate->setMitigations([ 'Can be caused by specific ViewHelpers. If this is is not intentional: avoid ViewHelpers which disable caches.', - 'If cache is intentionally disabled: consider using `f:cache.static` to cause otherwise uncompilable ViewHelpers\' output to be replaced with a static string in compiled templates.' + 'If cache is intentionally disabled: consider using `f:cache.static` to cause otherwise uncompilable ViewHelpers\' output to be replaced with a static string in compiled templates.', ]); } catch (ExpressionException $error) { $parsedTemplate->setFailureReason(sprintf('ExpressionNode evaluation error: %s', $error->getMessage())); $parsedTemplate->setMitigations([ - 'Emulate variables used in ExpressionNode using `f:cache.warmup` or assign in warming RenderingContext' + 'Emulate variables used in ExpressionNode using `f:cache.warmup` or assign in warming RenderingContext', ]); } catch (\TYPO3Fluid\Fluid\Core\Parser\Exception $error) { $parsedTemplate->setFailureReason($error->getMessage()); @@ -283,25 +283,25 @@ protected function warmSingleFile($templatePathAndFilename, $identifier, Renderi 'Fix possible syntax errors.', 'Check that all ViewHelpers are correctly referenced and namespaces loaded (note: namespaces may be added externally!)', 'Check that all ExpressionNode types used by the template are loaded (note: may depend on RenderingContext implementation!)', - 'Emulate missing variables used in expressions by using `f:cache.warmup` around your template code.' + 'Emulate missing variables used in expressions by using `f:cache.warmup` around your template code.', ]); } catch (\TYPO3Fluid\Fluid\Core\ViewHelper\Exception $error) { $parsedTemplate->setFailureReason(sprintf('ViewHelper threw Exception: %s', $error->getMessage())); $parsedTemplate->setMitigations([ 'Emulate missing variables using `f:cache.warmup` around failing ViewHelper.', 'Emulate globals / context required by ViewHelper.', - 'Disable caching for template if ViewHelper depends on globals / context that cannot be emulated.' + 'Disable caching for template if ViewHelper depends on globals / context that cannot be emulated.', ]); } catch (\TYPO3Fluid\Fluid\Core\Exception $error) { $parsedTemplate->setFailureReason(sprintf('Fluid engine error: %s', $error->getMessage())); $parsedTemplate->setMitigations([ - 'Search online for additional information about specific error.' + 'Search online for additional information about specific error.', ]); } catch (Exception $error) { $parsedTemplate->setFailureReason(sprintf('Fluid view error: %s', $error->getMessage())); $parsedTemplate->setMitigations([ 'Investigate reported error in View class for missing variable checks, missing configuration etc.', - 'Consider using a different View class for rendering in warmup mode (a custom rendering context can provide it)' + 'Consider using a different View class for rendering in warmup mode (a custom rendering context can provide it)', ]); } catch (\RuntimeException $error) { $parsedTemplate->setFailureReason( @@ -310,11 +310,11 @@ protected function warmSingleFile($templatePathAndFilename, $identifier, Renderi get_class($error), $error->getFile(), $error->getLine(), - $error->getMessage() - ) + $error->getMessage(), + ), ); $parsedTemplate->setMitigations([ - 'There are no automated suggestions for mitigating this issue. An online search may yield more information.' + 'There are no automated suggestions for mitigating this issue. An online search may yield more information.', ]); } return $parsedTemplate; diff --git a/src/Core/Compiler/TemplateCompiler.php b/src/Core/Compiler/TemplateCompiler.php index 6a6baf6fc..3cee3659d 100644 --- a/src/Core/Compiler/TemplateCompiler.php +++ b/src/Core/Compiler/TemplateCompiler.php @@ -192,7 +192,7 @@ public function store($identifier, ParsingState $parsingState) // RootNode, we could just call $parsingState->getRootNode()->compile(). $this->convertSubNodes($parsingState->getRootNode()->getChildNodes()), 'render', - 'Main Render function' + 'Main Render function', ); $storedLayoutName = $parsingState->getVariableContainer()->get('layoutName'); @@ -214,7 +214,7 @@ public function store($identifier, ParsingState $parsingState) $this->generateCodeForLayoutName($storedLayoutName), ($parsingState->hasLayout() ? 'true' : 'false'), var_export($this->renderingContext->getViewHelperResolver()->getNamespaces(), true), - $generatedRenderFunctions + $generatedRenderFunctions, ); $this->renderingContext->getCache()->set($identifier, $templateCode); return $templateCode; @@ -250,7 +250,7 @@ protected function generateSectionCodeFromParsingState(ParsingState $parsingStat // and call $node->convert($this) directly. $this->convertSubNodes($sectionRootNode->getChildNodes()), 'section_' . sha1($sectionName), - 'section ' . $sectionName + 'section ' . $sectionName, ); } } @@ -285,7 +285,7 @@ protected function generateCodeForSection(array $converted, string $methodName, '}' . chr(10), $comment, $methodName, - $execution + $execution, ); } return sprintf( @@ -299,7 +299,7 @@ protected function generateCodeForSection(array $converted, string $methodName, $comment, $methodName, $initialization, - $execution + $execution, ); } @@ -354,7 +354,7 @@ private function convertSubNodes(array $nodes): array case 0: return [ 'initialization' => '', - 'execution' => 'NULL' + 'execution' => 'NULL', ]; case 1: $childNode = current($nodes); @@ -376,7 +376,7 @@ private function convertSubNodes(array $nodes): array } return [ 'initialization' => $initializationPhpCode, - 'execution' => $outputVariableName + 'execution' => $outputVariableName, ]; } } diff --git a/src/Core/Compiler/ViewHelperCompiler.php b/src/Core/Compiler/ViewHelperCompiler.php index 7f14bda2a..5e6a9a2ef 100644 --- a/src/Core/Compiler/ViewHelperCompiler.php +++ b/src/Core/Compiler/ViewHelperCompiler.php @@ -93,8 +93,8 @@ public function compileWithCallToStaticMethod(ViewHelperInterface $viewHelper, $ $onClass, $method, $argumentsName, - $renderChildrenClosureName - ) + $renderChildrenClosureName, + ), ]; } } diff --git a/src/Core/Parser/SyntaxTree/AbstractNode.php b/src/Core/Parser/SyntaxTree/AbstractNode.php index a7c013c54..c5dc6983f 100644 --- a/src/Core/Parser/SyntaxTree/AbstractNode.php +++ b/src/Core/Parser/SyntaxTree/AbstractNode.php @@ -106,7 +106,7 @@ public function convert(TemplateCompiler $templateCompiler): array { return [ 'initialization' => '// Uncompilable node type: ' . get_class($this) . chr(10), - 'execution' => '' + 'execution' => '', ]; } } diff --git a/src/Core/Parser/SyntaxTree/ArrayNode.php b/src/Core/Parser/SyntaxTree/ArrayNode.php index df2d2e88e..00a909209 100644 --- a/src/Core/Parser/SyntaxTree/ArrayNode.php +++ b/src/Core/Parser/SyntaxTree/ArrayNode.php @@ -54,21 +54,21 @@ public function convert(TemplateCompiler $templateCompiler): array $initializationPhpCode .= sprintf( '\'%s\' => %s,' . chr(10), $key, - $converted['execution'] + $converted['execution'], ); } elseif (is_numeric($value)) { // handle int, float, numeric strings $initializationPhpCode .= sprintf( '\'%s\' => %s,' . chr(10), $key, - $value + $value, ); } else { // handle strings $initializationPhpCode .= sprintf( '\'%s\' => \'%s\',' . chr(10), $key, - str_replace(['\\', '\''], ['\\\\', '\\\''], $value) + str_replace(['\\', '\''], ['\\\\', '\\\''], $value), ); } } @@ -76,7 +76,7 @@ public function convert(TemplateCompiler $templateCompiler): array return [ 'initialization' => $accumulatedInitializationPhpCode . chr(10) . $initializationPhpCode, - 'execution' => $arrayVariableName + 'execution' => $arrayVariableName, ]; } } diff --git a/src/Core/Parser/SyntaxTree/BooleanNode.php b/src/Core/Parser/SyntaxTree/BooleanNode.php index 8cbeaa734..b29f87230 100644 --- a/src/Core/Parser/SyntaxTree/BooleanNode.php +++ b/src/Core/Parser/SyntaxTree/BooleanNode.php @@ -176,8 +176,8 @@ public function convert(TemplateCompiler $templateCompiler): array BooleanNode::class, $functionName, BooleanNode::class, - $stack['execution'] - ) + $stack['execution'], + ), ]; } } diff --git a/src/Core/Parser/SyntaxTree/EscapingNode.php b/src/Core/Parser/SyntaxTree/EscapingNode.php index 6a6ceb1e6..54f44b308 100644 --- a/src/Core/Parser/SyntaxTree/EscapingNode.php +++ b/src/Core/Parser/SyntaxTree/EscapingNode.php @@ -73,7 +73,7 @@ public function convert(TemplateCompiler $templateCompiler): array 'call_user_func_array( function ($var) { ' . 'return (is_string($var) || (is_object($var) && method_exists($var, \'__toString\')) ' . '? htmlspecialchars((string) $var, ENT_QUOTES) : $var); }, [%s])', - $configuration['execution'] + $configuration['execution'], ); } return $configuration; diff --git a/src/Core/Parser/SyntaxTree/Expression/AbstractExpressionNode.php b/src/Core/Parser/SyntaxTree/Expression/AbstractExpressionNode.php index 125133538..b4902b254 100644 --- a/src/Core/Parser/SyntaxTree/Expression/AbstractExpressionNode.php +++ b/src/Core/Parser/SyntaxTree/Expression/AbstractExpressionNode.php @@ -86,8 +86,8 @@ public function compile(TemplateCompiler $templateCompiler) '\%s::evaluateExpression($renderingContext, %s, %s)', $handlerClass, $expressionVariable, - $matchesVariable - ) + $matchesVariable, + ), ]; } diff --git a/src/Core/Parser/SyntaxTree/Expression/CastingExpressionNode.php b/src/Core/Parser/SyntaxTree/Expression/CastingExpressionNode.php index 6ffd49c6c..f1c9e783e 100644 --- a/src/Core/Parser/SyntaxTree/Expression/CastingExpressionNode.php +++ b/src/Core/Parser/SyntaxTree/Expression/CastingExpressionNode.php @@ -22,7 +22,7 @@ class CastingExpressionNode extends AbstractExpressionNode * @var array */ protected static $validTypes = [ - 'integer', 'boolean', 'string', 'float', 'array', 'DateTime' + 'integer', 'boolean', 'string', 'float', 'array', 'DateTime', ]; /** @@ -61,8 +61,8 @@ public static function evaluateExpression(RenderingContextInterface $renderingCo sprintf( 'Invalid target conversion type "%s" specified in casting expression "{%s}".', $type, - $expression - ) + $expression, + ), ); } return self::convertStatic($variable, $type); diff --git a/src/Core/Parser/SyntaxTree/Expression/TernaryExpressionNode.php b/src/Core/Parser/SyntaxTree/Expression/TernaryExpressionNode.php index 74bc116a5..9f4b4558b 100644 --- a/src/Core/Parser/SyntaxTree/Expression/TernaryExpressionNode.php +++ b/src/Core/Parser/SyntaxTree/Expression/TernaryExpressionNode.php @@ -148,7 +148,7 @@ public function compile(TemplateCompiler $templateCompiler) static::class, var_export($then, true), static::class, - var_export($else, true) + var_export($else, true), ); return [ @@ -157,8 +157,8 @@ public function compile(TemplateCompiler $templateCompiler) '%s(%s::gatherContext($renderingContext, %s[1]), $renderingContext)', $functionName, static::class, - $matchesVariable - ) + $matchesVariable, + ), ]; } } diff --git a/src/Core/Parser/SyntaxTree/ObjectAccessorNode.php b/src/Core/Parser/SyntaxTree/ObjectAccessorNode.php index 81f6c2e17..066601950 100644 --- a/src/Core/Parser/SyntaxTree/ObjectAccessorNode.php +++ b/src/Core/Parser/SyntaxTree/ObjectAccessorNode.php @@ -92,8 +92,8 @@ public function convert(TemplateCompiler $templateCompiler): array 'initialization' => '', 'execution' => sprintf( '$renderingContext->getVariableProvider()->getByPath(\'%s\')', - $path - ) + $path, + ), ]; } } diff --git a/src/Core/Parser/SyntaxTree/RootNode.php b/src/Core/Parser/SyntaxTree/RootNode.php index 6bb53350b..9c81fa972 100644 --- a/src/Core/Parser/SyntaxTree/RootNode.php +++ b/src/Core/Parser/SyntaxTree/RootNode.php @@ -38,7 +38,7 @@ public function convert(TemplateCompiler $templateCompiler): array case 0: return [ 'initialization' => '', - 'execution' => 'NULL' + 'execution' => 'NULL', ]; case 1: $childNode = current($this->getChildNodes()); @@ -59,7 +59,7 @@ public function convert(TemplateCompiler $templateCompiler): array return [ 'initialization' => $initializationPhpCode, - 'execution' => $outputVariableName + 'execution' => $outputVariableName, ]; } } diff --git a/src/Core/Parser/TemplateParser.php b/src/Core/Parser/TemplateParser.php index 68b904cfe..9e03989ff 100644 --- a/src/Core/Parser/TemplateParser.php +++ b/src/Core/Parser/TemplateParser.php @@ -169,10 +169,10 @@ public function createParsingRelatedExceptionWithContext(\Exception $error, $tem $character, $error->getMessage(), $error->getCode(), - $templateCode + $templateCode, ), $error->getCode(), - $error + $error, ); } @@ -213,7 +213,7 @@ protected function parseTemplateSource($templateIdentifier, $templateSourceClosu { $parsedTemplate = $this->parse( $templateSourceClosure($this, $this->renderingContext->getTemplatePaths()), - $templateIdentifier + $templateIdentifier, ); $parsedTemplate->setIdentifier($templateIdentifier); $this->parsedTemplates[$templateIdentifier] = $parsedTemplate; @@ -289,26 +289,26 @@ protected function buildObjectTree(array $splitTemplate, $context) $matchedVariables['MethodIdentifier'], $matchedVariables['Attributes'], ($matchedVariables['Selfclosing'] === '' ? false : true), - $templateElement + $templateElement, )) { continue; } } catch (\TYPO3Fluid\Fluid\Core\ViewHelper\Exception $error) { $this->textHandler( $state, - $this->renderingContext->getErrorHandler()->handleViewHelperError($error) + $this->renderingContext->getErrorHandler()->handleViewHelperError($error), ); } catch (Exception $error) { $this->textHandler( $state, - $this->renderingContext->getErrorHandler()->handleParserError($error) + $this->renderingContext->getErrorHandler()->handleParserError($error), ); } } elseif (preg_match(Patterns::$SCAN_PATTERN_TEMPLATE_CLOSINGVIEWHELPERTAG, $templateElement, $matchedVariables) > 0) { if ($this->closingViewHelperTagHandler( $state, $matchedVariables['NamespaceIdentifier'], - $matchedVariables['MethodIdentifier'] + $matchedVariables['MethodIdentifier'], )) { continue; } @@ -319,7 +319,7 @@ protected function buildObjectTree(array $splitTemplate, $context) if ($state->countNodeStack() !== 1) { throw new Exception( 'Not all tags were closed!', - 1238169398 + 1238169398, ); } return $state; @@ -352,7 +352,7 @@ protected function openingViewHelperTagHandler(ParsingState $state, $namespaceId $state, $namespaceIdentifier, $methodIdentifier, - $this->parseArguments($arguments, $viewHelper) + $this->parseArguments($arguments, $viewHelper), ); if ($viewHelperNode && $selfclosing === true) { @@ -390,7 +390,7 @@ protected function initializeViewHelperAndAddItToStack(ParsingState $state, $nam $this->renderingContext, $namespaceIdentifier, $methodIdentifier, - $argumentsObjectTree + $argumentsObjectTree, ); $this->callInterceptor($currentViewHelperNode, InterceptorInterface::INTERCEPT_OPENING_VIEWHELPER, $state); @@ -401,12 +401,12 @@ protected function initializeViewHelperAndAddItToStack(ParsingState $state, $nam } catch (\TYPO3Fluid\Fluid\Core\ViewHelper\Exception $error) { $this->textHandler( $state, - $this->renderingContext->getErrorHandler()->handleViewHelperError($error) + $this->renderingContext->getErrorHandler()->handleViewHelperError($error), ); } catch (Exception $error) { $this->textHandler( $state, - $this->renderingContext->getErrorHandler()->handleParserError($error) + $this->renderingContext->getErrorHandler()->handleParserError($error), ); } return null; @@ -440,7 +440,7 @@ protected function closingViewHelperTagHandler(ParsingState $state, $namespaceId throw new Exception( 'Templating tags not properly nested. Expected: ' . $expectedViewHelperClassName . '; Actual: ' . $actualViewHelperClassName, - 1224485398 + 1224485398, ); } $this->callInterceptor($lastStackElement, InterceptorInterface::INTERCEPT_CLOSING_VIEWHELPER, $state); @@ -494,7 +494,7 @@ protected function objectAccessorHandler(ParsingState $state, $objectAccessorStr $state, $singleMatch['NamespaceIdentifier'], $singleMatch['MethodIdentifier'], - $arguments + $arguments, ); if ($viewHelperNode) { $numberOfViewHelpers++; @@ -668,7 +668,7 @@ protected function textAndShorthandSyntaxHandler(ParsingState $state, $text, $co $matchedVariables['Object'], $matchedVariables['Delimiter'], (isset($matchedVariables['ViewHelper']) ? $matchedVariables['ViewHelper'] : ''), - (isset($matchedVariables['AdditionalViewHelpers']) ? $matchedVariables['AdditionalViewHelpers'] : '') + (isset($matchedVariables['AdditionalViewHelpers']) ? $matchedVariables['AdditionalViewHelpers'] : ''), ); } elseif ($context === self::CONTEXT_INSIDE_VIEWHELPER_ARGUMENTS && preg_match(Patterns::$SCAN_PATTERN_SHORTHANDSYNTAX_ARRAYS, $section, $matchedVariables) > 0 @@ -708,7 +708,7 @@ protected function textAndShorthandSyntaxHandler(ParsingState $state, $text, $co } catch (ExpressionException $error) { $this->textHandler( $state, - $this->renderingContext->getErrorHandler()->handleExpressionError($error) + $this->renderingContext->getErrorHandler()->handleExpressionError($error), ); } } diff --git a/src/Core/Parser/TemplateProcessor/EscapingModifierTemplateProcessor.php b/src/Core/Parser/TemplateProcessor/EscapingModifierTemplateProcessor.php index 042699f93..c769ec02d 100644 --- a/src/Core/Parser/TemplateProcessor/EscapingModifierTemplateProcessor.php +++ b/src/Core/Parser/TemplateProcessor/EscapingModifierTemplateProcessor.php @@ -50,7 +50,7 @@ public function preProcessSource($templateSource) if (count($matches) > 1) { throw new Exception( 'There is more than one escaping modifier defined. There can only be one {escapingEnabled=...} per template.', - 1407331080 + 1407331080, ); } if ($matches === []) { diff --git a/src/Core/Rendering/RenderingContext.php b/src/Core/Rendering/RenderingContext.php index 2a2a2093d..0639035df 100644 --- a/src/Core/Rendering/RenderingContext.php +++ b/src/Core/Rendering/RenderingContext.php @@ -136,8 +136,8 @@ public function __construct() [ new EscapingModifierTemplateProcessor(), new PassthroughSourceModifierTemplateProcessor(), - new NamespaceDetectionTemplateProcessor() - ] + new NamespaceDetectionTemplateProcessor(), + ], ); $this->setViewHelperResolver(new ViewHelperResolver()); $this->setViewHelperInvoker(new ViewHelperInvoker()); diff --git a/src/Core/ViewHelper/AbstractConditionViewHelper.php b/src/Core/ViewHelper/AbstractConditionViewHelper.php index 9a055f4a0..3ff2f53dc 100644 --- a/src/Core/ViewHelper/AbstractConditionViewHelper.php +++ b/src/Core/ViewHelper/AbstractConditionViewHelper.php @@ -232,7 +232,7 @@ final public function convert(TemplateCompiler $templateCompiler): array $argumentInitializationCode .= sprintf( '\'%s\' => %s,' . chr(10), $argumentName, - is_array($defaultValue) && empty($defaultValue) ? '[]' : var_export($defaultValue, true) + is_array($defaultValue) && empty($defaultValue) ? '[]' : var_export($defaultValue, true), ); } elseif ($arguments[$argumentName] instanceof NodeInterface) { // Argument *is* given to VH and is a node, resolve @@ -241,7 +241,7 @@ final public function convert(TemplateCompiler $templateCompiler): array $argumentInitializationCode .= sprintf( '\'%s\' => %s,' . chr(10), $argumentName, - $converted['execution'] + $converted['execution'], ); } else { // Argument *is* given to VH and is a simple type. @@ -249,7 +249,7 @@ final public function convert(TemplateCompiler $templateCompiler): array $argumentInitializationCode .= sprintf( '\'%s\' => %s,' . chr(10), $argumentName, - $arguments[$argumentName] + $arguments[$argumentName], ); } } @@ -267,7 +267,7 @@ final public function convert(TemplateCompiler $templateCompiler): array $thenChildEncountered = true; $argumentInitializationCode .= sprintf( '\'__then\' => %s,' . chr(10), - $templateCompiler->wrapChildNodesInClosure($childNode) + $templateCompiler->wrapChildNodesInClosure($childNode), ); continue; } @@ -282,7 +282,7 @@ final public function convert(TemplateCompiler $templateCompiler): array ' ],' . chr(10), $elseIfCounter, $templateCompiler->wrapViewHelperNodeArgumentEvaluationInClosure($childNode, 'if'), - $templateCompiler->wrapChildNodesInClosure($childNode) + $templateCompiler->wrapChildNodesInClosure($childNode), ); $elseIfCounter++; continue; @@ -293,7 +293,7 @@ final public function convert(TemplateCompiler $templateCompiler): array $elseChildEncountered = true; $argumentInitializationCode .= sprintf( '\'__else\' => %s,' . chr(10), - $templateCompiler->wrapChildNodesInClosure($childNode) + $templateCompiler->wrapChildNodesInClosure($childNode), ); } } @@ -304,7 +304,7 @@ final public function convert(TemplateCompiler $templateCompiler): array // then the entire body is considered the "then" child. $argumentInitializationCode .= sprintf( '\'__then\' => %s,' . chr(10), - $templateCompiler->wrapChildNodesInClosure($node) + $templateCompiler->wrapChildNodesInClosure($node), ); } @@ -322,7 +322,7 @@ final public function convert(TemplateCompiler $templateCompiler): array '%s::renderStatic(%s, static fn() => \'\', $renderingContext)' . chr(10), get_class($this), $argumentsVariableName, - ) + ), ]; } } diff --git a/src/Core/ViewHelper/AbstractViewHelper.php b/src/Core/ViewHelper/AbstractViewHelper.php index 54b9fc2f3..c7057c63a 100644 --- a/src/Core/ViewHelper/AbstractViewHelper.php +++ b/src/Core/ViewHelper/AbstractViewHelper.php @@ -165,7 +165,7 @@ protected function registerArgument($name, $type, $description, $required = fals if (array_key_exists($name, $this->argumentDefinitions)) { throw new Exception( 'Argument "' . $name . '" has already been defined, thus it should not be defined again.', - 1253036401 + 1253036401, ); } $this->argumentDefinitions[$name] = new ArgumentDefinition($name, $type, $description, $required, $defaultValue, $escape); @@ -192,7 +192,7 @@ protected function overrideArgument($name, $type, $description, $required = fals if (!array_key_exists($name, $this->argumentDefinitions)) { throw new Exception( 'Argument "' . $name . '" has not been defined, thus it can\'t be overridden.', - 1279212461 + 1279212461, ); } $this->argumentDefinitions[$name] = new ArgumentDefinition($name, $type, $description, $required, $defaultValue, $escape); @@ -265,8 +265,8 @@ protected function callRenderMethod() 'ViewHelper class "%s" does not declare a "render()" method and inherits the default "renderStatic". ' . 'Executing this ViewHelper would cause infinite recursion - please either implement "render()" or ' . '"renderStatic()" on your ViewHelper class', - get_class($this) - ) + get_class($this), + ), ); } @@ -346,7 +346,7 @@ public function validateArguments() throw new \InvalidArgumentException( 'The argument "' . $argumentName . '" was registered with type "' . $type . '", but is of type "' . $givenType . '" in view helper "' . get_class($this) . '".', - 1256475113 + 1256475113, ); } } @@ -463,8 +463,8 @@ public function validateAdditionalArguments(array $arguments) 'Undeclared arguments passed to ViewHelper %s: %s. Valid arguments are: %s', get_class($this), implode(', ', array_keys($arguments)), - implode(', ', array_keys($this->argumentDefinitions)) - ) + implode(', ', array_keys($this->argumentDefinitions)), + ), ); } } @@ -487,7 +487,7 @@ public function compile($argumentsName, $closureName, &$initializationPhpCode, V '%s::renderStatic(%s, %s, $renderingContext)', get_class($this), $argumentsName, - $closureName + $closureName, ); } @@ -541,7 +541,7 @@ public function convert(TemplateCompiler $templateCompiler): array $renderChildrenClosureVariableName, $viewHelperInitializationPhpCode, $this->viewHelperNode, - $templateCompiler + $templateCompiler, ); $accumulatedArgumentInitializationCode = ''; @@ -556,7 +556,7 @@ public function convert(TemplateCompiler $templateCompiler): array $argumentInitializationCode .= sprintf( '\'%s\' => %s,' . chr(10), $argumentName, - is_array($defaultValue) && empty($defaultValue) ? '[]' : var_export($defaultValue, true) + is_array($defaultValue) && empty($defaultValue) ? '[]' : var_export($defaultValue, true), ); } else { // Argument *is* given to VH, resolve @@ -569,13 +569,13 @@ public function convert(TemplateCompiler $templateCompiler): array $argumentInitializationCode .= sprintf( '\'%s\' => %s,' . chr(10), $argumentName, - $converted['execution'] + $converted['execution'], ); } else { $argumentInitializationCode .= sprintf( '\'%s\' => %s,' . chr(10), $argumentName, - $argumentValue + $argumentValue, ); } } @@ -587,7 +587,7 @@ public function convert(TemplateCompiler $templateCompiler): array $initializationPhpCode .= sprintf( '%s = %s;' . chr(10), $renderChildrenClosureVariableName, - $templateCompiler->wrapChildNodesInClosure($this->viewHelperNode) + $templateCompiler->wrapChildNodesInClosure($this->viewHelperNode), ); $initializationPhpCode .= $accumulatedArgumentInitializationCode . chr(10) . $argumentInitializationCode . $viewHelperInitializationPhpCode; @@ -599,7 +599,7 @@ public function convert(TemplateCompiler $templateCompiler): array 'initialization' => $initializationPhpCode, // @todo: compile() *should* return strings, but it's not enforced in the interface. // The string cast is here to stay compatible in case something still returns for instance null. - 'execution' => (string)$convertedViewHelperExecutionCode === '' ? "''" : $convertedViewHelperExecutionCode + 'execution' => (string)$convertedViewHelperExecutionCode === '' ? "''" : $convertedViewHelperExecutionCode, ]; } } diff --git a/src/Core/ViewHelper/TagBuilder.php b/src/Core/ViewHelper/TagBuilder.php index 943ab430d..b6f63d799 100644 --- a/src/Core/ViewHelper/TagBuilder.php +++ b/src/Core/ViewHelper/TagBuilder.php @@ -197,7 +197,7 @@ public function addAttribute($attributeName, $attributeValue, $escapeSpecialChar if (!in_array($attributeName, ['data', 'aria'], true)) { throw new \InvalidArgumentException( sprintf('Value of tag attribute "%s" cannot be of type array.', $attributeName), - 1709565127 + 1709565127, ); } diff --git a/src/Core/ViewHelper/Traits/CompileWithContentArgumentAndRenderStatic.php b/src/Core/ViewHelper/Traits/CompileWithContentArgumentAndRenderStatic.php index 2adc3604d..9eb5bd7ee 100644 --- a/src/Core/ViewHelper/Traits/CompileWithContentArgumentAndRenderStatic.php +++ b/src/Core/ViewHelper/Traits/CompileWithContentArgumentAndRenderStatic.php @@ -72,7 +72,7 @@ public function render() return static::renderStatic( $this->arguments, $this->buildRenderChildrenClosure(), - $this->renderingContext + $this->renderingContext, ); } @@ -89,13 +89,13 @@ public function compile( $closureName, &$initializationPhpCode, ViewHelperNode $node, - TemplateCompiler $compiler + TemplateCompiler $compiler, ) { $execution = sprintf( '%s::renderStatic(%s, %s, $renderingContext)', static::class, $argumentsName, - $closureName + $closureName, ); $contentArgumentName = $this->resolveContentArgumentName(); @@ -107,7 +107,7 @@ public function compile( $argumentsName, $argumentsName, $contentArgumentName, - $closureName + $closureName, ); return $execution; } @@ -152,7 +152,7 @@ public function resolveContentArgumentName() } throw new Exception( sprintf('Attempting to compile %s failed. Chosen compile method requires that ViewHelper has ' . - 'at least one registered and optional argument', __CLASS__) + 'at least one registered and optional argument', __CLASS__), ); } return $this->contentArgumentName; diff --git a/src/Core/ViewHelper/Traits/CompileWithRenderStatic.php b/src/Core/ViewHelper/Traits/CompileWithRenderStatic.php index 87e6eb4f9..7123f649b 100644 --- a/src/Core/ViewHelper/Traits/CompileWithRenderStatic.php +++ b/src/Core/ViewHelper/Traits/CompileWithRenderStatic.php @@ -31,7 +31,7 @@ public function render() return static::renderStatic( $this->arguments, $this->buildRenderChildrenClosure(), - $this->renderingContext + $this->renderingContext, ); } @@ -53,13 +53,13 @@ public function compile( $closureName, &$initializationPhpCode, ViewHelperNode $node, - TemplateCompiler $compiler + TemplateCompiler $compiler, ) { return sprintf( '%s::renderStatic(%s, %s, $renderingContext)', static::class, $argumentsName, - $closureName + $closureName, ); } } diff --git a/src/Core/ViewHelper/ViewHelperResolver.php b/src/Core/ViewHelper/ViewHelperResolver.php index bdd52b452..eb4e440cb 100644 --- a/src/Core/ViewHelper/ViewHelperResolver.php +++ b/src/Core/ViewHelper/ViewHelperResolver.php @@ -35,7 +35,7 @@ class ViewHelperResolver * @var array */ protected $namespaces = [ - 'f' => ['TYPO3Fluid\\Fluid\\ViewHelpers'] + 'f' => ['TYPO3Fluid\\Fluid\\ViewHelpers'], ]; /** @@ -250,7 +250,7 @@ public function resolveViewHelperClassName($namespaceIdentifier, $methodIdentifi 'Based on your spelling, the system would load the class "%s", however this class does not exist.', $namespaceIdentifier, $methodIdentifier, - $resolvedViewHelperClassName + $resolvedViewHelperClassName, ), 1407060572); } $this->resolvedViewHelperClassNames[$namespaceIdentifier][$methodIdentifier] = $actualViewHelperClassName; diff --git a/src/Core/ViewHelper/ViewHelperVariableContainer.php b/src/Core/ViewHelper/ViewHelperVariableContainer.php index bd0f49bb9..a45d7ac86 100644 --- a/src/Core/ViewHelper/ViewHelperVariableContainer.php +++ b/src/Core/ViewHelper/ViewHelperVariableContainer.php @@ -57,12 +57,12 @@ public function addAll($viewHelperName, $variables) throw new \InvalidArgumentException( 'Invalid argument type for $variables in ViewHelperVariableContainer->addAll(). Expects array/Traversable ' . 'but received ' . (is_object($variables) ? get_class($variables) : gettype($variables)), - 1501425195 + 1501425195, ); } $this->objects[$viewHelperName] = array_replace_recursive( isset($this->objects[$viewHelperName]) ? $this->objects[$viewHelperName] : [], - $variables instanceof \Traversable ? iterator_to_array($variables) : $variables + $variables instanceof \Traversable ? iterator_to_array($variables) : $variables, ); } diff --git a/src/Tools/ConsoleRunner.php b/src/Tools/ConsoleRunner.php index 35d152c09..40442908b 100644 --- a/src/Tools/ConsoleRunner.php +++ b/src/Tools/ConsoleRunner.php @@ -54,7 +54,7 @@ class ConsoleRunner self::ARGUMENT_TEMPLATEROOTPATHS => 'Template root paths, multiple paths can be passed separated by spaces', self::ARGUMENT_PARTIALROOTPATHS => 'Partial root paths, multiple paths can be passed separated by spaces', self::ARGUMENT_LAYOUTROOTPATHS => 'Layout root paths, multiple paths can be passed separated by spaces', - self::ARGUMENT_RENDERINGCONTEXT => 'Class name of custom RenderingContext implementation to use when rendering' + self::ARGUMENT_RENDERINGCONTEXT => 'Class name of custom RenderingContext implementation to use when rendering', ]; /** @@ -79,7 +79,7 @@ public function handleCommand(array $arguments) call_user_func(explode('::', $arguments[self::ARGUMENT_BOOTSTRAP])); } else { throw new \InvalidArgumentException( - 'Provided bootstrap argument is neither a file nor an executable, public, static function!' + 'Provided bootstrap argument is neither a file nor an executable, public, static function!', ); } } @@ -150,18 +150,18 @@ protected function renderWarmupResult(FluidCacheWarmupResult $result) "%s\n Compiled? %s\n Has Layout? %s\n", $templatePathAndFilename, $aspects[FluidCacheWarmupResult::RESULT_COMPILABLE] ? 'YES' : 'NO', - $aspects[FluidCacheWarmupResult::RESULT_HASLAYOUT] ? 'YES' : 'NO' + $aspects[FluidCacheWarmupResult::RESULT_HASLAYOUT] ? 'YES' : 'NO', ); if (isset($aspects[FluidCacheWarmupResult::RESULT_COMPILABLE])) { $string .= sprintf( " Compiled as: %s\n", - $aspects[FluidCacheWarmupResult::RESULT_COMPILEDCLASS] + $aspects[FluidCacheWarmupResult::RESULT_COMPILEDCLASS], ); } if (isset($aspects[FluidCacheWarmupResult::RESULT_FAILURE])) { $string .= sprintf( " Compilation failure reason: %s\n", - $aspects[FluidCacheWarmupResult::RESULT_FAILURE] + $aspects[FluidCacheWarmupResult::RESULT_FAILURE], ); } if (isset($aspects[FluidCacheWarmupResult::RESULT_MITIGATIONS])) { @@ -261,7 +261,7 @@ protected function parseTemplatePathAndFilenameFromScgiHeaders($input) protected function createErrorResponse($response, $code) { $headers = [ - 'HTTP/1.1 ' . $code . ' ' . $response + 'HTTP/1.1 ' . $code . ' ' . $response, ]; return implode("\n", $headers) . "\n\n" . $response; } @@ -278,7 +278,7 @@ protected function createResponse($response) 'Connection:keep-alive', 'Content-Type:text/html;charset=utf-8', 'Content-Length:' . strlen($response), - 'Pragma:no-cache' + 'Pragma:no-cache', ]; return implode("\n", $headers) . "\n\n" . $response; } diff --git a/src/View/AbstractTemplateView.php b/src/View/AbstractTemplateView.php index d2c211dbb..82f812b7c 100644 --- a/src/View/AbstractTemplateView.php +++ b/src/View/AbstractTemplateView.php @@ -190,7 +190,7 @@ public function render($actionName = null) $templatePaths->getLayoutIdentifier($layoutName), function ($parent, TemplatePaths $paths) use ($layoutName) { return $paths->getLayoutSource($layoutName); - } + }, ); } catch (PassthroughSourceException $error) { return $error->getSource(); @@ -250,7 +250,7 @@ public function renderSection($sectionName, array $variables = [], $ignoreUnknow return ''; } return $renderingContext->getErrorHandler()->handleViewError( - new InvalidSectionException('Section "' . $sectionName . '" does not exist.') + new InvalidSectionException('Section "' . $sectionName . '" does not exist.'), ); } $this->startRendering($renderingTypeOnNextLevel, $parsedTemplate, $renderingContext); @@ -263,7 +263,7 @@ public function renderSection($sectionName, array $variables = [], $ignoreUnknow return ''; } return $renderingContext->getErrorHandler()->handleViewError( - new InvalidSectionException('Section "' . $sectionName . '" does not exist.') + new InvalidSectionException('Section "' . $sectionName . '" does not exist.'), ); } /** @var ViewHelperNode $section */ @@ -272,7 +272,7 @@ public function renderSection($sectionName, array $variables = [], $ignoreUnknow $renderingContext->getViewHelperVariableContainer()->add( SectionViewHelper::class, 'isCurrentlyRenderingSection', - true + true, ); $this->startRendering($renderingTypeOnNextLevel, $parsedTemplate, $renderingContext); @@ -301,7 +301,7 @@ public function renderPartial($partialName, $sectionName = null, array $variable $templatePaths->getPartialIdentifier($partialName), function ($parent, TemplatePaths $paths) use ($partialName) { return $paths->getPartialSource($partialName); - } + }, ); } catch (PassthroughSourceException $error) { return $error->getSource(); @@ -383,7 +383,7 @@ protected function getCurrentParsedTemplate() $templatePaths->getTemplateIdentifier($controllerName, $actionName), function ($parent, TemplatePaths $paths) use ($controllerName, $actionName) { return $paths->getTemplateSource($controllerName, $actionName); - } + }, ); if ($parsedTemplate->isCompiled()) { $parsedTemplate->addCompiledNamespaces($this->baseRenderingContext); diff --git a/src/View/TemplatePaths.php b/src/View/TemplatePaths.php index 768a76748..ead6ee67b 100644 --- a/src/View/TemplatePaths.php +++ b/src/View/TemplatePaths.php @@ -59,7 +59,7 @@ class TemplatePaths protected $resolvedIdentifiers = [ self::NAME_TEMPLATES => [], self::NAME_LAYOUTS => [], - self::NAME_PARTIALS => [] + self::NAME_PARTIALS => [], ]; /** @@ -70,7 +70,7 @@ class TemplatePaths protected $resolvedFiles = [ self::NAME_TEMPLATES => [], self::NAME_LAYOUTS => [], - self::NAME_PARTIALS => [] + self::NAME_PARTIALS => [], ]; /** @@ -128,7 +128,7 @@ public function toArray() return [ self::CONFIG_TEMPLATEROOTPATHS => $this->sanitizePaths($this->getTemplateRootPaths()), self::CONFIG_LAYOUTROOTPATHS => $this->sanitizePaths($this->getLayoutRootPaths()), - self::CONFIG_PARTIALROOTPATHS => $this->sanitizePaths($this->getPartialRootPaths()) + self::CONFIG_PARTIALROOTPATHS => $this->sanitizePaths($this->getPartialRootPaths()), ]; } @@ -488,7 +488,7 @@ protected function extractPathArrays(array $paths) $pathParts = [ self::CONFIG_TEMPLATEROOTPATHS, self::CONFIG_LAYOUTROOTPATHS, - self::CONFIG_PARTIALROOTPATHS + self::CONFIG_PARTIALROOTPATHS, ]; $pathCollections = []; foreach ($pathParts as $pathPart) { @@ -600,9 +600,9 @@ public function getTemplateSource($controller = 'Default', $action = 'Default') $action, $format, $templateReference === null ? $controller . '/' . ucfirst($action) . '.' . $format : $templateReference, - count($this->getTemplateRootPaths()) ? 'The following paths were checked: ' . implode(', ', $this->getTemplateRootPaths()) : 'No paths configured.' + count($this->getTemplateRootPaths()) ? 'The following paths were checked: ' . implode(', ', $this->getTemplateRootPaths()) : 'No paths configured.', ), - 1257246929 + 1257246929, ); } return file_get_contents($templateReference); @@ -727,7 +727,7 @@ protected function resolveFileInPaths(array $paths, $relativePathAndFilename, $f } throw new InvalidTemplateResourceException( 'The Fluid template files "' . implode('", "', $tried) . '" could not be loaded.', - 1225709595 + 1225709595, ); } @@ -742,7 +742,7 @@ protected function clearResolvedIdentifiersAndTemplates($type = null) $this->resolvedIdentifiers = $this->resolvedFiles = [ self::NAME_TEMPLATES => [], self::NAME_LAYOUTS => [], - self::NAME_PARTIALS => [] + self::NAME_PARTIALS => [], ]; } } diff --git a/src/ViewHelpers/Cache/WarmupViewHelper.php b/src/ViewHelpers/Cache/WarmupViewHelper.php index fb35c7ac4..0f930475a 100644 --- a/src/ViewHelpers/Cache/WarmupViewHelper.php +++ b/src/ViewHelpers/Cache/WarmupViewHelper.php @@ -80,7 +80,7 @@ public function initializeArguments() 'array', 'Array of variables to assign ONLY when compiling. See main class documentation.', false, - [] + [], ); } @@ -103,7 +103,7 @@ public function render() } $originalVariableProvider = static::overlayVariablesIfNotSet( $this->renderingContext, - $this->arguments['variables'] + $this->arguments['variables'], ); $content = $this->renderChildren(); $this->renderingContext->setVariableProvider($originalVariableProvider); @@ -143,7 +143,7 @@ protected static function overlayVariablesIfNotSet(RenderingContextInterface $re $currentProvider = $renderingContext->getVariableProvider(); $chainedVariableProvider = new ChainedVariableProvider([ $currentProvider, - new StandardVariableProvider($variables) + new StandardVariableProvider($variables), ]); $renderingContext->setVariableProvider($chainedVariableProvider); return $currentProvider; diff --git a/src/ViewHelpers/CountViewHelper.php b/src/ViewHelpers/CountViewHelper.php index a79bc69c8..9721cadf9 100644 --- a/src/ViewHelpers/CountViewHelper.php +++ b/src/ViewHelpers/CountViewHelper.php @@ -78,8 +78,8 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl throw new ViewHelper\Exception( sprintf( 'Subject given to f:count() is not countable (type: %s)', - is_object($countable) ? get_class($countable) : gettype($countable) - ) + is_object($countable) ? get_class($countable) : gettype($countable), + ), ); } return count($countable); diff --git a/src/ViewHelpers/DebugViewHelper.php b/src/ViewHelpers/DebugViewHelper.php index 1ccdadda1..aff03d190 100644 --- a/src/ViewHelpers/DebugViewHelper.php +++ b/src/ViewHelpers/DebugViewHelper.php @@ -110,7 +110,7 @@ protected static function dumpVariable($variable, $html, $level, $levels) '%s"%s": %s', str_repeat(' ', $level), $property, - static::dumpVariable($value, $html, $level + 1, $levels) + static::dumpVariable($value, $html, $level + 1, $levels), ); } } @@ -120,7 +120,7 @@ protected static function dumpVariable($variable, $html, $level, $levels) $string = sprintf( '%s = %s', $typeLabel, - htmlspecialchars(var_export($variable, true), ENT_COMPAT, 'UTF-8', false) + htmlspecialchars(var_export($variable, true), ENT_COMPAT, 'UTF-8', false), ); } else { $string = sprintf('%s', $typeLabel); @@ -132,7 +132,7 @@ protected static function dumpVariable($variable, $html, $level, $levels) $string .= sprintf( '
  • %s: %s
  • ', $property, - static::dumpVariable($value, $html, $level + 1, $levels) + static::dumpVariable($value, $html, $level + 1, $levels), ); } $string .= ''; @@ -162,7 +162,7 @@ protected static function getValuesOfNonScalarVariable($variable) return [ 'class' => get_class($variable), 'ISO8601' => $variable->format(\DateTime::ATOM), - 'UNIXTIME' => (int)$variable->format('U') + 'UNIXTIME' => (int)$variable->format('U'), ]; } $reflection = new \ReflectionObject($variable); diff --git a/src/ViewHelpers/FirstViewHelper.php b/src/ViewHelpers/FirstViewHelper.php index 73e1f8f0f..03da1b35d 100644 --- a/src/ViewHelpers/FirstViewHelper.php +++ b/src/ViewHelpers/FirstViewHelper.php @@ -45,7 +45,7 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl throw new \InvalidArgumentException( 'The argument "value" was registered with type "array", but is of type "' . $givenType . '" in view helper "' . static::class . '".', - 1712220569 + 1712220569, ); } diff --git a/src/ViewHelpers/ForViewHelper.php b/src/ViewHelpers/ForViewHelper.php index ad436df0a..6e2451ca2 100644 --- a/src/ViewHelpers/ForViewHelper.php +++ b/src/ViewHelpers/ForViewHelper.php @@ -123,7 +123,7 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl $iterationData = [ 'index' => 0, 'cycle' => 1, - 'total' => count($arguments['each']) + 'total' => count($arguments['each']), ]; } diff --git a/src/ViewHelpers/Format/CdataViewHelper.php b/src/ViewHelpers/Format/CdataViewHelper.php index e66389f37..6e179c7ac 100644 --- a/src/ViewHelpers/Format/CdataViewHelper.php +++ b/src/ViewHelpers/Format/CdataViewHelper.php @@ -80,7 +80,7 @@ public function initializeArguments() public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext + RenderingContextInterface $renderingContext, ) { return sprintf('', $renderChildrenClosure()); } diff --git a/src/ViewHelpers/Format/HtmlspecialcharsViewHelper.php b/src/ViewHelpers/Format/HtmlspecialcharsViewHelper.php index dbae3745a..11efe5dcf 100644 --- a/src/ViewHelpers/Format/HtmlspecialcharsViewHelper.php +++ b/src/ViewHelpers/Format/HtmlspecialcharsViewHelper.php @@ -110,7 +110,7 @@ public function compile($argumentsName, $closureName, &$initializationPhpCode, V return sprintf( '!is_string(%1$s) && !(is_object(%1$s) && method_exists(%1$s, \'__toString\')) ? %1$s : htmlspecialchars(%1$s, (%2$s[\'keepQuotes\'] ? ENT_NOQUOTES : ENT_QUOTES), %2$s[\'encoding\'], %2$s[\'doubleEncode\'])', $valueVariableName, - $argumentsName + $argumentsName, ); } } diff --git a/src/ViewHelpers/Format/RawViewHelper.php b/src/ViewHelpers/Format/RawViewHelper.php index 1ef5afe04..f2b308f06 100644 --- a/src/ViewHelpers/Format/RawViewHelper.php +++ b/src/ViewHelpers/Format/RawViewHelper.php @@ -105,7 +105,7 @@ public function compile($argumentsName, $closureName, &$initializationPhpCode, V $contentArgumentName, $argumentsName, $contentArgumentName, - $closureName + $closureName, ); } } diff --git a/src/ViewHelpers/Format/TrimViewHelper.php b/src/ViewHelpers/Format/TrimViewHelper.php index 93fa30c7d..403275f73 100644 --- a/src/ViewHelpers/Format/TrimViewHelper.php +++ b/src/ViewHelpers/Format/TrimViewHelper.php @@ -119,7 +119,7 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl self::SIDE_RIGHT, self::SIDE_END => rtrim($value, $characters), default => throw new Exception( 'The side "' . $side . '" supplied to Fluid\'s format.trim ViewHelper is not supported.', - 1669191560 + 1669191560, ), }; } diff --git a/src/ViewHelpers/GroupedForViewHelper.php b/src/ViewHelpers/GroupedForViewHelper.php index b35f666c8..40a2e9d72 100644 --- a/src/ViewHelpers/GroupedForViewHelper.php +++ b/src/ViewHelpers/GroupedForViewHelper.php @@ -134,7 +134,7 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl $localVariableProvider = new StandardVariableProvider(); $renderingContext->setVariableProvider(new ScopedVariableProvider( $globalVariableProvider, - $localVariableProvider + $localVariableProvider, )); foreach ($groups['values'] as $currentGroupIndex => $group) { diff --git a/src/ViewHelpers/InlineViewHelper.php b/src/ViewHelpers/InlineViewHelper.php index cc520eba5..05ca05155 100644 --- a/src/ViewHelpers/InlineViewHelper.php +++ b/src/ViewHelpers/InlineViewHelper.php @@ -45,7 +45,7 @@ public function initializeArguments() $this->registerArgument( 'code', 'string', - 'Fluid code to be rendered as if it were part of the template rendering it. Can be passed as inline argument or tag content' + 'Fluid code to be rendered as if it were part of the template rendering it. Can be passed as inline argument or tag content', ); } @@ -58,7 +58,7 @@ public function initializeArguments() public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext + RenderingContextInterface $renderingContext, ) { return $renderingContext->getTemplateParser()->parse((string)$renderChildrenClosure())->render($renderingContext); } diff --git a/src/ViewHelpers/JoinViewHelper.php b/src/ViewHelpers/JoinViewHelper.php index 73e4e693a..4b75d3bdf 100644 --- a/src/ViewHelpers/JoinViewHelper.php +++ b/src/ViewHelpers/JoinViewHelper.php @@ -85,7 +85,7 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl throw new \InvalidArgumentException( 'The argument "value" was registered with type "array", but is of type "' . $givenType . '" in view helper "' . static::class . '".', - 1256475113 + 1256475113, ); } diff --git a/src/ViewHelpers/LastViewHelper.php b/src/ViewHelpers/LastViewHelper.php index e9ae21c69..656d9eef5 100644 --- a/src/ViewHelpers/LastViewHelper.php +++ b/src/ViewHelpers/LastViewHelper.php @@ -45,7 +45,7 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl throw new \InvalidArgumentException( 'The argument "value" was registered with type "array", but is of type "' . $givenType . '" in view helper "' . static::class . '".', - 1712221620 + 1712221620, ); } diff --git a/src/ViewHelpers/LayoutViewHelper.php b/src/ViewHelpers/LayoutViewHelper.php index ba16ca41f..ea8cb0dce 100644 --- a/src/ViewHelpers/LayoutViewHelper.php +++ b/src/ViewHelpers/LayoutViewHelper.php @@ -69,7 +69,7 @@ final public function convert(TemplateCompiler $templateCompiler): array public static function postParseEvent( ViewHelperNode $node, array $arguments, - VariableProviderInterface $variableContainer + VariableProviderInterface $variableContainer, ) { if (isset($arguments['name'])) { $layoutNameNode = $arguments['name']; diff --git a/src/ViewHelpers/RenderViewHelper.php b/src/ViewHelpers/RenderViewHelper.php index def26358f..b5e0b714b 100644 --- a/src/ViewHelpers/RenderViewHelper.php +++ b/src/ViewHelpers/RenderViewHelper.php @@ -149,7 +149,7 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl 'a reference to the View. Normally this is taken care of by the TemplateView, so most likely this ' . 'error is because you overrode AbstractTemplateView->initializeRenderingContext() and did not call ' . '$renderingContext->getViewHelperVariableContainer()->setView($this) or parent::initializeRenderingContext. ' . - 'This is an issue you must fix in your code as f:render is fully unable to render anything without a View.' + 'This is an issue you must fix in your code as f:render is fully unable to render anything without a View.', ); } $content = ''; diff --git a/src/ViewHelpers/SwitchViewHelper.php b/src/ViewHelpers/SwitchViewHelper.php index 2aebadb7e..7aa57f111 100644 --- a/src/ViewHelpers/SwitchViewHelper.php +++ b/src/ViewHelpers/SwitchViewHelper.php @@ -196,7 +196,7 @@ public function compile($argumentsName, $closureName, &$initializationPhpCode, V $phpCode .= sprintf( 'case call_user_func(%s): return call_user_func(%s);', $valueClosure, - $childrenClosure + $childrenClosure, ) . PHP_EOL; } } diff --git a/src/ViewHelpers/VariableViewHelper.php b/src/ViewHelpers/VariableViewHelper.php index d3a636c93..076a5e582 100644 --- a/src/ViewHelpers/VariableViewHelper.php +++ b/src/ViewHelpers/VariableViewHelper.php @@ -52,7 +52,7 @@ public function initializeArguments() public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext + RenderingContextInterface $renderingContext, ) { $value = $renderChildrenClosure(); $renderingContext->getVariableProvider()->add($arguments['name'], $value); diff --git a/tests/BaseTestCase.php b/tests/BaseTestCase.php index 9735b55c6..321552371 100644 --- a/tests/BaseTestCase.php +++ b/tests/BaseTestCase.php @@ -36,7 +36,7 @@ protected function getAccessibleMock( string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, - bool $callAutoload = true + bool $callAutoload = true, ) { $builder = $this->getMockBuilder($this->buildAccessibleProxy($originalClassName)) ->setConstructorArgs($arguments) @@ -120,7 +120,7 @@ protected function getMock( array $arguments = [], bool $callOriginalConstructor = true, bool $callOriginalClone = true, - bool $callAutoload = true + bool $callAutoload = true, ) { $builder = $this->getMockBuilder($originalClassName); if ($methods !== null) { @@ -148,7 +148,7 @@ protected function getAccessibleMockForAbstractClass( string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, - bool $callAutoload = true + bool $callAutoload = true, ): object { return $this->getMockForAbstractClass($this->buildAccessibleProxy($originalClassName), $arguments, $mockClassName, $callOriginalConstructor, $callOriginalClone, $callAutoload); } diff --git a/tests/Functional/Cases/Conditions/BasicConditionsTest.php b/tests/Functional/Cases/Conditions/BasicConditionsTest.php index 4074b7879..32c1acc26 100644 --- a/tests/Functional/Cases/Conditions/BasicConditionsTest.php +++ b/tests/Functional/Cases/Conditions/BasicConditionsTest.php @@ -43,7 +43,7 @@ public static function basicConditionDataProvider(): array // groups ['(1 && (\'foo\' == \'foo\') && (TRUE || 1)) && 0 != 1', true], - ['(1 && (\'foo\' == \'foo\') && (TRUE || 1)) && 0 != 1 && FALSE', false] + ['(1 && (\'foo\' == \'foo\') && (TRUE || 1)) && 0 != 1 && FALSE', false], ]; } diff --git a/tests/Functional/Cases/Conditions/VariableConditionsTest.php b/tests/Functional/Cases/Conditions/VariableConditionsTest.php index ce0183bcd..a104dcab3 100644 --- a/tests/Functional/Cases/Conditions/VariableConditionsTest.php +++ b/tests/Functional/Cases/Conditions/VariableConditionsTest.php @@ -25,7 +25,7 @@ public static function variableConditionDataProvider(): array $someObject->someFloat = 13.37; $someObject->someBoolean = true; $someArray = [ - 'foo' => 'bar' + 'foo' => 'bar', ]; $emptyCountable = new \SplObjectStorage(); @@ -85,7 +85,7 @@ public static function variableConditionDataProvider(): array ['{emptyCountable} || FALSE', false, ['emptyCountable' => $emptyCountable]], ['FALSE || {emptyCountable}', false, ['emptyCountable' => $emptyCountable]], // inline if-viewhelper condition with countable objects - ['{f:if(condition: \'{emptyCountable} || FALSE\', else: \'1\')} == 1)', true, ['emptyCountable' => $emptyCountable]] + ['{f:if(condition: \'{emptyCountable} || FALSE\', else: \'1\')} == 1)', true, ['emptyCountable' => $emptyCountable]], ]; } diff --git a/tests/Functional/Cases/Errors/ParsingErrorsTest.php b/tests/Functional/Cases/Errors/ParsingErrorsTest.php index 880f70d08..afa3686cb 100644 --- a/tests/Functional/Cases/Errors/ParsingErrorsTest.php +++ b/tests/Functional/Cases/Errors/ParsingErrorsTest.php @@ -41,7 +41,7 @@ public static function getTemplateCodeFixturesAndExpectations(): array ], 'Uses invalid namespace cached' => [ '', - UnknownNamespaceException::class + UnknownNamespaceException::class, ], ]; } diff --git a/tests/Functional/Cases/Rendering/DataAccessorTest.php b/tests/Functional/Cases/Rendering/DataAccessorTest.php index 993d89771..aefba19ec 100644 --- a/tests/Functional/Cases/Rendering/DataAccessorTest.php +++ b/tests/Functional/Cases/Rendering/DataAccessorTest.php @@ -25,7 +25,7 @@ public static function renderDataProvider(): array '["{data.value}"]', [ 'data' => [ - 'value' => 'value' + 'value' => 'value', ], ], [ @@ -69,7 +69,7 @@ public static function renderDataProvider(): array [ 'privateValue@GETPRIVATEVALUE()', 'protectedValue@GETPROTECTEDVALUE()', - 'publicValue@GETPUBLICVALUE()' + 'publicValue@GETPUBLICVALUE()', ], ], 'multiple accessor types' => [ @@ -80,7 +80,7 @@ public static function renderDataProvider(): array [ 'privateValue@getPrivateValue()', 'protectedValue@getProtectedValue()', - 'publicValue@getPublicValue()' + 'publicValue@getPublicValue()', ], ], ]; diff --git a/tests/Functional/Cases/Rendering/RecursiveRenderingTest.php b/tests/Functional/Cases/Rendering/RecursiveRenderingTest.php index 98b707e34..36b3c9d33 100644 --- a/tests/Functional/Cases/Rendering/RecursiveRenderingTest.php +++ b/tests/Functional/Cases/Rendering/RecursiveRenderingTest.php @@ -22,7 +22,7 @@ public function recursiveSectionRenderingClonesVariableStorageAndRestoresAfterLo $source = file_get_contents(__DIR__ . '/../../Fixtures/Templates/RecursiveSectionRendering.html'); $variables = [ 'settings' => [ - 'test' => 'Bla' + 'test' => 'Bla', ], 'items' => [ [ @@ -33,22 +33,22 @@ public function recursiveSectionRenderingClonesVariableStorageAndRestoresAfterLo 'items' => [ [ 'id' => 3, - 'items' => [] - ] - ] - ] - ] + 'items' => [], + ], + ], + ], + ], ], [ - 'id' => 4 - ] - ] + 'id' => 4, + ], + ], ]; $expectations = [ 'Item: 1.', 'Item: 2.', 'Item: 3.', - 'Item: 4.' + 'Item: 4.', ]; $view = new TemplateView(); @@ -80,7 +80,7 @@ public function recursivePartialRenderingClonesVariableStorageAndRestoresAfterLo $source = file_get_contents(__DIR__ . '/../../Fixtures/Templates/RecursivePartialRendering.html'); $variables = [ 'settings' => [ - 'test' => 'Bla' + 'test' => 'Bla', ], 'items' => [ [ @@ -91,22 +91,22 @@ public function recursivePartialRenderingClonesVariableStorageAndRestoresAfterLo 'items' => [ [ 'id' => 3, - 'items' => [] - ] - ] - ] - ] + 'items' => [], + ], + ], + ], + ], ], [ - 'id' => 4 - ] - ] + 'id' => 4, + ], + ], ]; $expectations = [ 'Item: 1.', 'Item: 2.', 'Item: 3.', - 'Item: 4.' + 'Item: 4.', ]; $view = new TemplateView(); diff --git a/tests/Functional/CommandTest.php b/tests/Functional/CommandTest.php index d992aa866..c6ecab19e 100644 --- a/tests/Functional/CommandTest.php +++ b/tests/Functional/CommandTest.php @@ -19,17 +19,17 @@ public static function getCommandTestValues(): array [ '%s --help', 'Use the CLI utility in the following modes', - 'Exception' + 'Exception', ], [ 'echo "Hello world!" | %s', 'Hello world!', - 'Exeption' + 'Exeption', ], [ 'echo "{foo}" | %s --variables "{\\"foo\\": \\"bar\\"}"', 'bar', - 'Exception', 'foo' + 'Exception', 'foo', ], ]; } diff --git a/tests/Functional/Core/Parser/SyntaxTree/Expression/TernaryExpressionNodeTest.php b/tests/Functional/Core/Parser/SyntaxTree/Expression/TernaryExpressionNodeTest.php index 53f1fe88d..00fd5afbd 100644 --- a/tests/Functional/Core/Parser/SyntaxTree/Expression/TernaryExpressionNodeTest.php +++ b/tests/Functional/Core/Parser/SyntaxTree/Expression/TernaryExpressionNodeTest.php @@ -241,7 +241,7 @@ public static function variableConditionDataProvider(): array '{(foo || 1 && 1 && !(false) || (1 % 2) || (1 > 0) || (\'foo\' == \'bar\')) ? \'yes\' : \'no\'}', [], 'yes', - ] + ], ]; } diff --git a/tests/Functional/Core/Parser/TemplateProcessor/NamespaceDetectionTemplateProcessorTest.php b/tests/Functional/Core/Parser/TemplateProcessor/NamespaceDetectionTemplateProcessorTest.php index 0154a5f53..1eac8d1c0 100644 --- a/tests/Functional/Core/Parser/TemplateProcessor/NamespaceDetectionTemplateProcessorTest.php +++ b/tests/Functional/Core/Parser/TemplateProcessor/NamespaceDetectionTemplateProcessorTest.php @@ -24,7 +24,7 @@ public static function preProcessSourceExtractsNamespacesDataProvider(): array [ 'f' => ['TYPO3Fluid\Fluid\ViewHelpers'], ], - '' + '', ], 'supports expression node style namespaces' => [ '{namespace x=X\\Y\\ViewHelpers}', @@ -32,7 +32,7 @@ public static function preProcessSourceExtractsNamespacesDataProvider(): array 'f' => ['TYPO3Fluid\Fluid\ViewHelpers'], 'x' => ['X\\Y\\ViewHelpers'], ], - '' + '', ], 'ignores blank expression node style namespaces' => [ '{namespace z}', @@ -40,7 +40,7 @@ public static function preProcessSourceExtractsNamespacesDataProvider(): array 'f' => ['TYPO3Fluid\Fluid\ViewHelpers'], 'z' => null, ], - '' + '', ], 'ignores unknown namespaces' => [ '' . PHP_EOL . '', @@ -48,7 +48,7 @@ public static function preProcessSourceExtractsNamespacesDataProvider(): array 'f' => ['TYPO3Fluid\Fluid\ViewHelpers'], 'unknown' => null, ], - PHP_EOL + PHP_EOL, ], 'supports xmlns detection, single' => [ '' . PHP_EOL . '', @@ -56,7 +56,7 @@ public static function preProcessSourceExtractsNamespacesDataProvider(): array 'f' => ['TYPO3Fluid\Fluid\ViewHelpers'], 'x' => ['X\\Y\\ViewHelpers'], ], - PHP_EOL + PHP_EOL, ], 'supports xmlns detection, leave tag in place' => [ '' . PHP_EOL . '', @@ -64,7 +64,7 @@ public static function preProcessSourceExtractsNamespacesDataProvider(): array 'f' => ['TYPO3Fluid\Fluid\ViewHelpers'], 'x' => ['X\\Y\\ViewHelpers'], ], - '' . PHP_EOL . '' + '' . PHP_EOL . '', ], 'supports xmlns detection, multiple' => [ '' . PHP_EOL . '', @@ -73,7 +73,7 @@ public static function preProcessSourceExtractsNamespacesDataProvider(): array 'x' => ['X\\Y\\ViewHelpers'], 'z' => ['X\\Z\\ViewHelpers'], ], - PHP_EOL + PHP_EOL, ], 'supports expression style namespace detection, camelCase' => [ '{namespace camelCase=X\\Y\\ViewHelpers}', @@ -81,7 +81,7 @@ public static function preProcessSourceExtractsNamespacesDataProvider(): array 'f' => ['TYPO3Fluid\Fluid\ViewHelpers'], 'camelCase' => ['X\\Y\\ViewHelpers'], ], - '' + '', ], 'supports xmlns detection, camelCase' => [ '' . PHP_EOL . '', @@ -89,7 +89,7 @@ public static function preProcessSourceExtractsNamespacesDataProvider(): array 'f' => ['TYPO3Fluid\Fluid\ViewHelpers'], 'camelCase' => ['X\\Y\\ViewHelpers'], ], - PHP_EOL + PHP_EOL, ], ]; } diff --git a/tests/Functional/ExamplesTest.php b/tests/Functional/ExamplesTest.php index a86d7bfbc..0e669a0f1 100644 --- a/tests/Functional/ExamplesTest.php +++ b/tests/Functional/ExamplesTest.php @@ -42,29 +42,29 @@ public static function exampleScriptValuesDataProvider(): array '$varfalse == $varfalse === TRUE', '$varfalse != $varfalse === FALSE', '$vararray1 == $vararray1 === TRUE', - '\'thisstring\' != \'thatstring\' === TRUE' - ] + '\'thisstring\' != \'thatstring\' === TRUE', + ], ], 'example_customresolving.php' => [ 'example_customresolving.php', [ var_export(['foo' => 'bar'], true), var_export(['bar' => 'foo'], true), - ] + ], ], 'example_format.php' => [ 'example_format.php', [ '"layout": "Default.json",', - '"foobar": "Variable foobar"' - ] + '"foobar": "Variable foobar"', + ], ], 'example_layoutless.php' => [ 'example_layoutless.php', [ 'This section is rendered below', - 'This text is rendered because it is outside the section' - ] + 'This text is rendered because it is outside the section', + ], ], 'example_math.php' => [ 'example_math.php', @@ -73,8 +73,8 @@ public static function exampleScriptValuesDataProvider(): array 'Expression: 4 * $numberten = 40', 'Expression: 4 / $numberten = ' . (0.4), // NOTE: concat'ing a float + string LC-casts the float to localized comma/t-sep. Hence, let PHP also cast the expected value. 'Expression: $numberone / $numberten = ' . (0.1), // NOTE: concat'ing a float + string LC-casts the float to localized comma/t-sep. Hence, let PHP also cast the expected value. - 'Expression: 10 ^ $numberten = 10000000000' - ] + 'Expression: 10 ^ $numberten = 10000000000', + ], ], 'example_multiplepaths.php' => [ 'example_multiplepaths.php', @@ -84,7 +84,7 @@ public static function exampleScriptValuesDataProvider(): array 'Value of "foobar": This is foobar.', 'Contents of FirstPartial.html', 'Overridden contents of SecondPartial.html', - ] + ], ], 'example_mvc.php' => [ 'example_mvc.php', @@ -92,36 +92,36 @@ public static function exampleScriptValuesDataProvider(): array 'I am the template belonging to the "Default" controller, action "Default".', 'I am the template belonging to the "Other" controller, action "Default".', 'I am the template belonging to the "Other" controller, action "List".', - 'Value of "foobar": MVC template.' - ] + 'Value of "foobar": MVC template.', + ], ], 'example_namespaces.php' => [ 'example_namespaces.php', [ 'Namespaces template', - 'This tag will be shown' - ] + 'This tag will be shown', + ], ], 'example_namespaceresolving.php' => [ 'example_namespaceresolving.php', [ 'NamespaceResolving template from Singles.', 'Argument passed to CustomViewHelper:', - '123' - ] + '123', + ], ], 'example_single.php' => [ 'example_single.php', [ - 'Value of "foobar": Single template' - ] + 'Value of "foobar": Single template', + ], ], 'example_escapingmodifier.php' => [ 'example_escapingmodifier.php', [ 'Value of "html": This is not escaped', 'From partial: This is not escaped', - ] + ], ], 'example_structures.php' => [ 'example_structures.php', @@ -140,8 +140,8 @@ public static function exampleScriptValuesDataProvider(): array 'This `f:else` was rendered', 'The value was "3"', 'The unmatched value case triggered', - 'The "b" nested switch case was triggered' - ] + 'The "b" nested switch case was triggered', + ], ], 'example_variables.php' => [ 'example_variables.php', @@ -163,21 +163,21 @@ public static function exampleScriptValuesDataProvider(): array 'Received $array.printf with formatted string Formatted string, value: formatted', 'Received $array.baz with value 42', 'Received $array.xyz.foobar with value Escaped sub-string', - 'Received $myVariable with value Nice string' - ] + 'Received $myVariable with value Nice string', + ], ], 'example_variableprovider.php' => [ 'example_variableprovider.php', [ 'VariableProvider template from Singles.', 'Random: random', - ] + ], ], 'example_dynamiclayout.php' => [ 'example_dynamiclayout.php', [ 'Rendered via DynamicLayout, section "Main":', - ] + ], ], 'example_cachestatic.php' => [ 'example_cachestatic.php', @@ -185,13 +185,13 @@ public static function exampleScriptValuesDataProvider(): array 'Cached as static text 1', 'Cached as static text 2', 'Cached as static text 3', - ] + ], ], 'example_passthrough.php' => [ 'example_passthrough.php', [ - 'This does not get parsed; the source is passed through with Fluid markup' - ] + 'This does not get parsed; the source is passed through with Fluid markup', + ], ], 'example_errorhandling.php' => [ 'example_errorhandling.php', @@ -202,8 +202,8 @@ public static function exampleScriptValuesDataProvider(): array 'Parser error: The ViewHelper "" could not be resolved.', 'Based on your spelling, the system would load the class "TYPO3Fluid\Fluid\ViewHelpers\InvalidViewHelper", however this class does not exist. Offending code: ', 'Invalid expression: Invalid target conversion type "invalidtype" specified in casting expression "{foobar as invalidtype}".', - ] - ] + ], + ], ]; } diff --git a/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticExplicitSetArgumentNameForContentInConstructorViewHelper.php b/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticExplicitSetArgumentNameForContentInConstructorViewHelper.php index 2cea49422..3691e414b 100644 --- a/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticExplicitSetArgumentNameForContentInConstructorViewHelper.php +++ b/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticExplicitSetArgumentNameForContentInConstructorViewHelper.php @@ -44,7 +44,7 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl 'arguments[secondOptionalArgument]' => $arguments['secondOptionalArgument'], 'renderChildrenClosure' => $renderChildrenClosure(), ], - JSON_PRETTY_PRINT + JSON_PRETTY_PRINT, ); } } diff --git a/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticExplicitSetArgumentNameForContentOverriddenResolveContentArgumentNameMethodViewHelper.php b/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticExplicitSetArgumentNameForContentOverriddenResolveContentArgumentNameMethodViewHelper.php index ef3ed19c9..24c11abae 100644 --- a/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticExplicitSetArgumentNameForContentOverriddenResolveContentArgumentNameMethodViewHelper.php +++ b/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticExplicitSetArgumentNameForContentOverriddenResolveContentArgumentNameMethodViewHelper.php @@ -40,7 +40,7 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl 'arguments[secondOptionalArgument]' => $arguments['secondOptionalArgument'], 'renderChildrenClosure' => $renderChildrenClosure(), ], - JSON_PRETTY_PRINT + JSON_PRETTY_PRINT, ); } diff --git a/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticFirstRegisteredOptionalArgumentAfterRequiredArgumentAsRenderChildrenViewHelper.php b/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticFirstRegisteredOptionalArgumentAfterRequiredArgumentAsRenderChildrenViewHelper.php index ba6d5824b..e1486fe72 100644 --- a/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticFirstRegisteredOptionalArgumentAfterRequiredArgumentAsRenderChildrenViewHelper.php +++ b/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticFirstRegisteredOptionalArgumentAfterRequiredArgumentAsRenderChildrenViewHelper.php @@ -37,7 +37,7 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl 'arguments[firstOptionalArgument]' => $arguments['firstOptionalArgument'], 'renderChildrenClosure' => $renderChildrenClosure(), ], - JSON_PRETTY_PRINT + JSON_PRETTY_PRINT, ); } } diff --git a/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticUseFirstRegisteredOptionalArgumentAsRenderChildrenViewHelper.php b/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticUseFirstRegisteredOptionalArgumentAsRenderChildrenViewHelper.php index 3aca76564..e914c6b4e 100644 --- a/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticUseFirstRegisteredOptionalArgumentAsRenderChildrenViewHelper.php +++ b/tests/Functional/Fixtures/ViewHelpers/CompileWithContentArgumentAndRenderStaticUseFirstRegisteredOptionalArgumentAsRenderChildrenViewHelper.php @@ -36,7 +36,7 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl 'arguments[firstOptionalArgument]' => $arguments['firstOptionalArgument'], 'renderChildrenClosure' => $renderChildrenClosure(), ], - JSON_PRETTY_PRINT + JSON_PRETTY_PRINT, ); } } diff --git a/tests/Functional/ViewHelpers/AliasViewHelperTest.php b/tests/Functional/ViewHelpers/AliasViewHelperTest.php index b8af4ab5b..51c0c4720 100644 --- a/tests/Functional/ViewHelpers/AliasViewHelperTest.php +++ b/tests/Functional/ViewHelpers/AliasViewHelperTest.php @@ -25,13 +25,13 @@ public static function renderDataProvider(): \Generator yield 'multiple aliases are defined' => [ '{y} {x}', [], - 'bar foo' + 'bar foo', ]; yield 'wrapped content is output even if map is empty' => [ 'wrapped content', ['emptyMap' => []], - 'wrapped content' + 'wrapped content', ]; yield 'defined alias does not exist anymore outside tag' => [ diff --git a/tests/Functional/ViewHelpers/DebugViewHelperTest.php b/tests/Functional/ViewHelpers/DebugViewHelperTest.php index 3a18b37f6..4f13b0dc7 100644 --- a/tests/Functional/ViewHelpers/DebugViewHelperTest.php +++ b/tests/Functional/ViewHelpers/DebugViewHelperTest.php @@ -20,45 +20,45 @@ public static function renderDataProvider(): \Generator yield 'not existing variable' => [ '{value}', [], - 'null' . PHP_EOL + 'null' . PHP_EOL, ]; yield 'not existing variable html' => [ '{value}', [], - 'NULL = NULL' + 'NULL = NULL', ]; yield 'null' => [ '{value}', ['value' => null], - 'null' . PHP_EOL + 'null' . PHP_EOL, ]; yield 'null html' => [ '{value}', ['value' => null], - 'NULL = NULL' + 'NULL = NULL', ]; yield 'string' => [ '{value}', ['value' => 'test'], - "string 'test'" . PHP_EOL + "string 'test'" . PHP_EOL, ]; yield 'string html' => [ '{value}', ['value' => 'test'], - "string = 'test'" + "string = 'test'", ]; yield 'html string' => [ '{value}', ['value' => 'testbold'], - "string 'testbold'" . PHP_EOL + "string 'testbold'" . PHP_EOL, ]; yield 'html string html' => [ '{value}', ['value' => 'testbold'], - "string = 'test<strong>bold</strong>'" + "string = 'test<strong>bold</strong>'", ]; yield 'array nested html string' => [ @@ -69,7 +69,7 @@ public static function renderDataProvider(): \Generator ], ], 'array: ' . PHP_EOL . - ' "nested": string \'testbold\'' . PHP_EOL + ' "nested": string \'testbold\'' . PHP_EOL, ]; yield 'array nested html string html' => [ '{value}', @@ -78,74 +78,74 @@ public static function renderDataProvider(): \Generator 'nested' => 'testbold', ], ], - "array" + "array", ]; yield 'type only' => [ '{value}', ['value' => 'test'], - 'string' + 'string', ]; yield 'type only html' => [ '{value}', ['value' => 'test'], - 'string' + 'string', ]; yield 'nested array' => [ '{value}', [ 'value' => [ - 'nested' => 'test' - ] + 'nested' => 'test', + ], ], 'array: ' . PHP_EOL . - ' "nested": string \'test\'' . PHP_EOL + ' "nested": string \'test\'' . PHP_EOL, ]; yield 'nested array html' => [ '{value}', [ 'value' => [ - 'nested' => 'test' - ] + 'nested' => 'test', + ], ], - 'array' + 'array', ]; yield 'array iterator object' => [ '{value}', ['value' => new \ArrayIterator(['foo' => 'bar'])], 'ArrayIterator: ' . PHP_EOL . - ' "foo": string \'bar\'' . PHP_EOL + ' "foo": string \'bar\'' . PHP_EOL, ]; yield 'array iterator object html' => [ '{value}', ['value' => new \ArrayIterator(['foo' => 'bar'])], - 'ArrayIterator' + 'ArrayIterator', ]; yield 'array object' => [ '{value}', ['value' => new \ArrayObject(['foo' => 'bar'])], 'ArrayObject: ' . PHP_EOL . - ' "foo": string \'bar\'' . PHP_EOL + ' "foo": string \'bar\'' . PHP_EOL, ]; yield 'array object html' => [ '{value}', ['value' => new \ArrayObject(['foo' => 'bar'])], - 'ArrayObject' + 'ArrayObject', ]; yield 'casual object' => [ '{value}', ['value' => new UserWithoutToString('username')], 'TYPO3Fluid\Fluid\Tests\Functional\Fixtures\Various\UserWithoutToString: ' . PHP_EOL . - ' "name": string \'username\'' . PHP_EOL + ' "name": string \'username\'' . PHP_EOL, ]; yield 'casual object html' => [ '{value}', ['value' => new UserWithoutToString('username')], - 'TYPO3Fluid\Fluid\Tests\Functional\Fixtures\Various\UserWithoutToString' + 'TYPO3Fluid\Fluid\Tests\Functional\Fixtures\Various\UserWithoutToString', ]; yield 'datetime object' => [ @@ -164,7 +164,7 @@ public static function renderDataProvider(): \Generator '
  • class: string = \'DateTime\'
  • ' . '
  • ISO8601: string = \'2016-07-12T13:08:35+00:00\'
  • ' . '
  • UNIXTIME: integer = 1468328915
  • ' . - '' + '', ]; $value = fopen('php://memory', 'r+'); @@ -197,7 +197,7 @@ public static function renderDataProvider(): \Generator '
  • unread_bytes: integer = 0
  • ' . '
  • seekable: boolean = true
  • ' . '
  • uri: string = \'php://memory\'
  • ' . - '' + '', ]; $arrayObject = new \ArrayObject(['foo' => 'bar']); @@ -245,7 +245,7 @@ public static function renderDataProvider(): \Generator '' . '' . '' . - '' + '', ]; } diff --git a/tests/Functional/ViewHelpers/ForViewHelperTest.php b/tests/Functional/ViewHelpers/ForViewHelperTest.php index f7b9ed3e3..02011f358 100644 --- a/tests/Functional/ViewHelpers/ForViewHelperTest.php +++ b/tests/Functional/ViewHelpers/ForViewHelperTest.php @@ -161,7 +161,7 @@ public static function renderDataProvider(): \Generator ['value' => $value], 'key: foo, item: fooValue, index: 0, cycle: 1, total: 3, isFirst: 1, isLast: , isEven: , isOdd: 1' . chr(10) . 'key: Fluid, item: FluidStandalone, index: 1, cycle: 2, total: 3, isFirst: , isLast: , isEven: 1, isOdd: ' . chr(10) . - 'key: TYPO3, item: rocks, index: 2, cycle: 3, total: 3, isFirst: , isLast: 1, isEven: , isOdd: 1' . chr(10) + 'key: TYPO3, item: rocks, index: 2, cycle: 3, total: 3, isFirst: , isLast: 1, isEven: , isOdd: 1' . chr(10), ]; $value = ['bar', 2]; diff --git a/tests/Functional/ViewHelpers/Format/CdataViewHelperTest.php b/tests/Functional/ViewHelpers/Format/CdataViewHelperTest.php index 271484d94..97627eb29 100644 --- a/tests/Functional/ViewHelpers/Format/CdataViewHelperTest.php +++ b/tests/Functional/ViewHelpers/Format/CdataViewHelperTest.php @@ -18,11 +18,11 @@ public static function renderDataProvider(): \Generator { yield 'empty argument and not empty tag content' => [ 'test1', - '' + '', ]; yield 'non empty argument and empty tag content' => [ '', - '' + '', ]; } diff --git a/tests/Functional/ViewHelpers/Format/HtmlspecialcharsViewHelperTest.php b/tests/Functional/ViewHelpers/Format/HtmlspecialcharsViewHelperTest.php index 9f128f76f..2124a3dbd 100644 --- a/tests/Functional/ViewHelpers/Format/HtmlspecialcharsViewHelperTest.php +++ b/tests/Functional/ViewHelpers/Format/HtmlspecialcharsViewHelperTest.php @@ -63,7 +63,7 @@ public static function renderDataProvider(): \Generator yield '[argument] render respects "keepQuotes" argument' => [ '', [], - 'Some special characters: &©"' + 'Some special characters: &©"', ]; yield '[argument] render respects "encoding" argument' => [ @@ -110,7 +110,7 @@ public static function renderDataProvider(): \Generator yield '[tag content] render respects "keepQuotes" argument' => [ 'Some special characters: &©"', [], - 'Some special characters: &©"' + 'Some special characters: &©"', ]; yield '[tag content] render respects "encoding" argument' => [ diff --git a/tests/Functional/ViewHelpers/GroupedForViewHelperTest.php b/tests/Functional/ViewHelpers/GroupedForViewHelperTest.php index 7f68cbaa6..bcd34dc37 100644 --- a/tests/Functional/ViewHelpers/GroupedForViewHelperTest.php +++ b/tests/Functional/ViewHelpers/GroupedForViewHelperTest.php @@ -359,7 +359,7 @@ public static function renderDataProvider(): \Generator 'wordpress' => ['name' => 'Wordpress', 'license' => 'GPL'], ], 'groupedProducts' => '[initial groupedProducts]', - 'myGroupKey' => '[initial myGroupKey]' + 'myGroupKey' => '[initial myGroupKey]', ], '[initial groupedProducts] [initial myGroupKey]', ]; diff --git a/tests/Functional/ViewHelpers/InlineViewHelperTest.php b/tests/Functional/ViewHelpers/InlineViewHelperTest.php index ac4481cc5..08d8bc53a 100644 --- a/tests/Functional/ViewHelpers/InlineViewHelperTest.php +++ b/tests/Functional/ViewHelpers/InlineViewHelperTest.php @@ -34,7 +34,7 @@ public static function renderDataProvider(): \Generator yield 'empty string' => [ '', [ - 'code' => '' + 'code' => '', ], null, ]; @@ -58,7 +58,7 @@ public static function renderDataProvider(): \Generator yield 'valid code with undefined variable' => [ '', [ - 'code' => '{f:if(condition: undefinedVariable, then: \'foo\', else: \'bar\')}' + 'code' => '{f:if(condition: undefinedVariable, then: \'foo\', else: \'bar\')}', ], 'bar', ]; @@ -66,7 +66,7 @@ public static function renderDataProvider(): \Generator '', [ 'code' => '{f:if(condition: definedVariable, then: \'foo\', else: \'bar\')}', - 'definedVariable' => true + 'definedVariable' => true, ], 'foo', ]; @@ -74,7 +74,7 @@ public static function renderDataProvider(): \Generator '{code}', [ 'code' => '{f:if(condition: definedVariable, then: \'foo\', else: \'bar\')}', - 'definedVariable' => true + 'definedVariable' => true, ], 'foo', ]; diff --git a/tests/Functional/ViewHelpers/JoinViewHelperTest.php b/tests/Functional/ViewHelpers/JoinViewHelperTest.php index 9eb108a94..44455181f 100644 --- a/tests/Functional/ViewHelpers/JoinViewHelperTest.php +++ b/tests/Functional/ViewHelpers/JoinViewHelperTest.php @@ -88,7 +88,7 @@ public static function renderValidDataProvider(): \Generator yield 'value inline and argument' => [ 'arguments' => [ 'valueInline' => [1, 2, 3], - 'valueArgument' => [3, 2, 1] + 'valueArgument' => [3, 2, 1], ], 'src' => '{valueInline -> f:join(value: valueArgument)}', 'expectation' => '321', diff --git a/tests/Unit/Core/Cache/FluidCacheWarmupResultTest.php b/tests/Unit/Core/Cache/FluidCacheWarmupResultTest.php index 9f1d7901b..c9eb085d5 100644 --- a/tests/Unit/Core/Cache/FluidCacheWarmupResultTest.php +++ b/tests/Unit/Core/Cache/FluidCacheWarmupResultTest.php @@ -85,8 +85,8 @@ public function addWorksWithParsedTemplate(): void FluidCacheWarmupResult::RESULT_COMPILABLE => true, FluidCacheWarmupResult::RESULT_COMPILED => false, FluidCacheWarmupResult::RESULT_HASLAYOUT => false, - FluidCacheWarmupResult::RESULT_COMPILEDCLASS => 'subject1-identifier' - ] + FluidCacheWarmupResult::RESULT_COMPILEDCLASS => 'subject1-identifier', + ], ]; self::assertSame($expected, $subject->getResults()); } @@ -110,8 +110,8 @@ public function addWorksWithFailedCompilingState(): void FluidCacheWarmupResult::RESULT_HASLAYOUT => true, FluidCacheWarmupResult::RESULT_COMPILEDCLASS => 'subject2-identifier', FluidCacheWarmupResult::RESULT_FAILURE => 'failure-reason', - FluidCacheWarmupResult::RESULT_MITIGATIONS => ['m1', 'm2'] - ] + FluidCacheWarmupResult::RESULT_MITIGATIONS => ['m1', 'm2'], + ], ]; $subject = new FluidCacheWarmupResult(); $subject->add($failedCompilingStateMock, 'foobar'); diff --git a/tests/Unit/Core/Cache/StandardCacheWarmerTest.php b/tests/Unit/Core/Cache/StandardCacheWarmerTest.php index 440c66a9a..e63ce666a 100644 --- a/tests/Unit/Core/Cache/StandardCacheWarmerTest.php +++ b/tests/Unit/Core/Cache/StandardCacheWarmerTest.php @@ -44,7 +44,7 @@ public static function warmupSingleFileHandlesExceptionDataProvider(): array [new \TYPO3Fluid\Fluid\Core\ViewHelper\Exception('ViewHelper exception')], [new \TYPO3Fluid\Fluid\Core\Exception('Fluid core exception')], [new \TYPO3Fluid\Fluid\View\Exception('Fluid view exception')], - [new \RuntimeException('General runtime exception')] + [new \RuntimeException('General runtime exception')], ]; } diff --git a/tests/Unit/Core/Parser/BooleanParserTest.php b/tests/Unit/Core/Parser/BooleanParserTest.php index 33f291c5e..be7354a83 100644 --- a/tests/Unit/Core/Parser/BooleanParserTest.php +++ b/tests/Unit/Core/Parser/BooleanParserTest.php @@ -103,7 +103,7 @@ public static function getSomeEvaluationTestValues(): array ['{foo}', true, ['foo' => true]], ['{foo} == FALSE', true, ['foo' => false]], - ['!{foo}', true, ['foo' => false]] + ['!{foo}', true, ['foo' => false]], ]; } diff --git a/tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture06-split.php b/tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture06-split.php index 258d26119..6aaffebdb 100644 --- a/tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture06-split.php +++ b/tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture06-split.php @@ -14,5 +14,5 @@ '{number}', '', '', - "\n" + "\n", ]; diff --git a/tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture14-split.php b/tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture14-split.php index 7b6f0f5c5..5876906d0 100644 --- a/tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture14-split.php +++ b/tests/Unit/Core/Parser/Fixtures/TemplateParserTestFixture14-split.php @@ -10,5 +10,5 @@ return [ '', '%.3e', - '' + '', ]; diff --git a/tests/Unit/Core/Parser/TemplateParserPatternTest.php b/tests/Unit/Core/Parser/TemplateParserPatternTest.php index 6bc968d2c..1bb66d862 100644 --- a/tests/Unit/Core/Parser/TemplateParserPatternTest.php +++ b/tests/Unit/Core/Parser/TemplateParserPatternTest.php @@ -93,7 +93,7 @@ public function testSCAN_PATTERN_DYNAMICTAG(): void 'Attributes' => ' attribute="Hallo"', 3 => ' attribute="Hallo"', 'Selfclosing' => '', - 4 => '' + 4 => '', ]; preg_match($pattern, $source, $matches); self::assertEquals($expected, $matches, 'The SCAN_PATTERN_DYNAMICTAG does not match correctly.'); @@ -109,7 +109,7 @@ public function testSCAN_PATTERN_DYNAMICTAG(): void 'Attributes' => ' data-attribute="Hallo"', 3 => ' data-attribute="Hallo"', 'Selfclosing' => '', - 4 => '' + 4 => '', ]; preg_match($pattern, $source, $matches); self::assertEquals($expected, $matches, 'The SCAN_PATTERN_DYNAMICTAG does not match correctly with data- attributes.'); @@ -124,7 +124,7 @@ public function testSCAN_PATTERN_DYNAMICTAG(): void 'Attributes' => '', 3 => '', 'Selfclosing' => '/', - 4 => '/' + 4 => '/', ]; preg_match($pattern, $source, $matches); self::assertEquals($expected, $matches, 'The SCAN_PATTERN_DYNAMICTAG does not match correctly when there is a space before the self-closing tag.'); @@ -139,7 +139,7 @@ public function testSCAN_PATTERN_DYNAMICTAG(): void 'Attributes' => ' attribute="Ha\"llo"', 3 => ' attribute="Ha\"llo"', 'Selfclosing' => '/', - 4 => '/' + 4 => '/', ]; preg_match($pattern, $source, $matches); self::assertEquals($expected, $matches, 'The SCAN_PATTERN_DYNAMICTAG does not match correctly with self-closing tags.'); @@ -154,7 +154,7 @@ public function testSCAN_PATTERN_DYNAMICTAG(): void 'Attributes' => ' complex:attribute="Ha>llo" a="b" c=\'d\'', 3 => ' complex:attribute="Ha>llo" a="b" c=\'d\'', 'Selfclosing' => '/', - 4 => '/' + 4 => '/', ]; preg_match($pattern, $source, $matches); self::assertEquals($expected, $matches, 'The SCAN_PATTERN_DYNAMICTAG does not match correctly with complex attributes and > inside the attributes.'); @@ -250,8 +250,8 @@ public function testSPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER(): void 2 => 'for', 'MethodIdentifier' => 'for', 3 => 'each: bla', - 'ViewHelperArguments' => 'each: bla' - ] + 'ViewHelperArguments' => 'each: bla', + ], ]; preg_match_all($pattern, $source, $matches, PREG_SET_ORDER); self::assertEquals($matches, $expected, 'The SPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER'); @@ -266,8 +266,8 @@ public function testSPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER(): void 2 => 'for', 'MethodIdentifier' => 'for', 3 => 'each: bla,', - 'ViewHelperArguments' => 'each: bla,' - ] + 'ViewHelperArguments' => 'each: bla,', + ], ]; preg_match_all($pattern, $source, $matches, PREG_SET_ORDER); self::assertEquals($matches, $expected, 'The SPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER'); @@ -282,8 +282,8 @@ public function testSPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER(): void 2 => 'for', 'MethodIdentifier' => 'for', 3 => 'each: bla, ', - 'ViewHelperArguments' => 'each: bla, ' - ] + 'ViewHelperArguments' => 'each: bla, ', + ], ]; preg_match_all($pattern, $source, $matches, PREG_SET_ORDER); self::assertEquals($matches, $expected, 'The SPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER'); @@ -297,7 +297,7 @@ public function testSPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER(): void 2 => 'for', 'MethodIdentifier' => 'for', 3 => 'each: bla', - 'ViewHelperArguments' => 'each: bla' + 'ViewHelperArguments' => 'each: bla', ], 1 => [ 0 => 'foo.bar:bla(a:"b\"->(f:a()", cd: {a:b})', @@ -306,8 +306,8 @@ public function testSPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER(): void 2 => 'bla', 'MethodIdentifier' => 'bla', 3 => 'a:"b\"->(f:a()", cd: {a:b}', - 'ViewHelperArguments' => 'a:"b\"->(f:a()", cd: {a:b}' - ] + 'ViewHelperArguments' => 'a:"b\"->(f:a()", cd: {a:b}', + ], ]; preg_match_all($pattern, $source, $matches, PREG_SET_ORDER); self::assertEquals($matches, $expected, 'The SPLIT_PATTERN_SHORTHANDSYNTAX_VIEWHELPER'); @@ -368,7 +368,7 @@ public static function dataProviderSCAN_PATTERN_SHORTHANDSYNTAX_ARRAYS(): array ['string' => '{"a":{bla:{x:z}, b: a}}'], ['string' => '{a:{bla:{"x":z}, b: a}}'], ['string' => '{"@a": "bar"}'], - ['string' => '{\'_b\': "bar"}'] + ['string' => '{\'_b\': "bar"}'], ]; } @@ -422,7 +422,7 @@ public function testSPLIT_PATTERN_SHORTHANDSYNTAX_ARRAY_PARTS(): void 'QuotedString' => '', 3 => '', 'VariableIdentifier' => 'b', - 4 => 'b' + 4 => 'b', ], 1 => [ 0 => 'e: {c:d, "e#":f, \'g\': "h"}', @@ -437,8 +437,8 @@ public function testSPLIT_PATTERN_SHORTHANDSYNTAX_ARRAY_PARTS(): void 'Number' => '', 5 => '', 'Subarray' => 'c:d, "e#":f, \'g\': "h"', - 6 => 'c:d, "e#":f, \'g\': "h"' - ] + 6 => 'c:d, "e#":f, \'g\': "h"', + ], ]; self::assertTrue($success); self::assertEquals($expected, $matches, 'The regular expression splitting the array apart does not work!'); @@ -464,7 +464,7 @@ public function SPLIT_PATTERN_SHORTHANDSYNTAX_ARRAY_PARTS_matchesQuotedKeys(): v 'QuotedString' => '', 3 => '', 'VariableIdentifier' => 'b', - 4 => 'b' + 4 => 'b', ], 1 => [ 0 => '\'c\': d', @@ -475,8 +475,8 @@ public function SPLIT_PATTERN_SHORTHANDSYNTAX_ARRAY_PARTS_matchesQuotedKeys(): v 'QuotedString' => '', 3 => '', 'VariableIdentifier' => 'd', - 4 => 'd' - ] + 4 => 'd', + ], ]; self::assertTrue($success); self::assertEquals($expected, $matches, 'The regular expression splitting the array apart does not work!'); @@ -497,9 +497,9 @@ public static function dataProviderValidArrayExpressionsBeginningAndEndingOnDigi 'QuotedString' => '', 3 => '', 'VariableIdentifier' => 'foo.bar1', - 4 => 'foo.bar1' - ] - ] + 4 => 'foo.bar1', + ], + ], ], [ 'expression' => '{"foo2": "bar2"}', @@ -511,9 +511,9 @@ public static function dataProviderValidArrayExpressionsBeginningAndEndingOnDigi 'Key' => '"foo2"', 2 => '"foo2"', 'QuotedString' => '"bar2"', - 3 => '"bar2"' - ] - ] + 3 => '"bar2"', + ], + ], ], [ 'expression' => '{foo3: bar.baz3}', @@ -527,9 +527,9 @@ public static function dataProviderValidArrayExpressionsBeginningAndEndingOnDigi 'QuotedString' => '', 3 => '', 'VariableIdentifier' => 'bar.baz3', - 4 => 'bar.baz3' - ] - ] + 4 => 'bar.baz3', + ], + ], ], [ 'expression' => '{foo4: _4bar.-baz4}', @@ -543,9 +543,9 @@ public static function dataProviderValidArrayExpressionsBeginningAndEndingOnDigi 'QuotedString' => '', 3 => '', 'VariableIdentifier' => '_4bar.-baz4', - 4 => '_4bar.-baz4' - ] - ] + 4 => '_4bar.-baz4', + ], + ], ], [ 'expression' => '{5foo5: -5bar}', @@ -559,9 +559,9 @@ public static function dataProviderValidArrayExpressionsBeginningAndEndingOnDigi 'QuotedString' => '', 3 => '', 'VariableIdentifier' => '-5bar', - 4 => '-5bar' - ] - ] + 4 => '-5bar', + ], + ], ], [ 'expression' => '{foo6: 66}', @@ -577,10 +577,10 @@ public static function dataProviderValidArrayExpressionsBeginningAndEndingOnDigi 'VariableIdentifier' => '', 4 => '', 'Number' => '66', - 5 => '66' - ] - ] - ] + 5 => '66', + ], + ], + ], ]; } @@ -596,7 +596,7 @@ public function SPLIT_PATTERN_SHORTHANDSYNTAX_ARRAY_PARTS_matchesKeysEndingInDig self::assertEquals( $expected, $matches, - 'The regular expression splitting the array apart does not work!' + 'The regular expression splitting the array apart does not work!', ); } diff --git a/tests/Unit/Core/Parser/TemplateParserTest.php b/tests/Unit/Core/Parser/TemplateParserTest.php index 63045e79a..f09687ad0 100644 --- a/tests/Unit/Core/Parser/TemplateParserTest.php +++ b/tests/Unit/Core/Parser/TemplateParserTest.php @@ -168,7 +168,7 @@ public function getOrParseAndStoreTemplateSetsAndStoresUncompilableStateInCache( $compiler->expects(self::atLeastOnce())->method('has')->willReturn(false); $compiler->expects(self::atLeastOnce())->method('store')->willReturnOnConsecutiveCalls( self::throwException(new StopCompilingException()), - true + true, ); $context->setTemplateCompiler($compiler); $context->setVariableProvider(new StandardVariableProvider()); @@ -197,7 +197,7 @@ public static function quotedStrings(): array ["'this \"string\" had \\'quotes\\' in it'", 'this "string" had \'quotes\' in it'], ['"this \\"string\\" had \'quotes\' in it"', 'this "string" had \'quotes\' in it'], ['"a weird \"string\" \'with\' *freaky* \\\\stuff', 'a weird "string" \'with\' *freaky* \\stuff'], - ['\'\\\'escaped quoted string in string\\\'\'', '\'escaped quoted string in string\''] + ['\'\\\'escaped quoted string in string\\\'\'', '\'escaped quoted string in string\''], ]; } @@ -216,7 +216,7 @@ public static function templatesToSplit() return [ ['TemplateParserTestFixture01-shorthand'], ['TemplateParserTestFixture06'], - ['TemplateParserTestFixture14'] + ['TemplateParserTestFixture14'], ]; } @@ -357,7 +357,7 @@ public static function parseArgumentsWorksAsExpectedDataProvider(): array return [ ['a="2"', ['a' => '2']], ['a="2" b="foobar \' with \\" quotes"', ['a' => '2', 'b' => 'foobar \' with " quotes']], - [' arguments="{number : 362525200}"', ['arguments' => '{number : 362525200}']] + [' arguments="{number : 362525200}"', ['arguments' => '{number : 362525200}']], ]; } @@ -465,21 +465,21 @@ public static function dataProviderRecursiveArrayHandler(): \Generator 'string' => 'number: 123', 'expected' => [ 'number' => 123, - ] + ], ]; yield 'Single quoted string' => [ 'string' => 'string: \'some.string\'', 'expected' => [ 'string' => new TextNode('some.string'), - ] + ], ]; yield 'Single identifier' => [ 'string' => 'identifier: some.identifier', 'expected' => [ - 'identifier' => new ObjectAccessorNode('some.identifier') - ] + 'identifier' => new ObjectAccessorNode('some.identifier'), + ], ]; yield 'Single subarray' => [ @@ -488,9 +488,9 @@ public static function dataProviderRecursiveArrayHandler(): \Generator 'array' => new ArrayNode([ 'number' => 123, 'string' => new TextNode('some.string'), - 'identifier' => new ObjectAccessorNode('some.identifier') - ]) - ] + 'identifier' => new ObjectAccessorNode('some.identifier'), + ]), + ], ]; yield 'Single subarray with numerical ids' => [ @@ -499,9 +499,9 @@ public static function dataProviderRecursiveArrayHandler(): \Generator 'array' => new ArrayNode([ 123, new TextNode('some.string'), - new ObjectAccessorNode('some.identifier') - ]) - ] + new ObjectAccessorNode('some.identifier'), + ]), + ], ]; yield 'Single quoted subarray' => [ @@ -509,8 +509,8 @@ public static function dataProviderRecursiveArrayHandler(): \Generator 'expected' => [ 'number' => 234, 'string' => new TextNode('some.string'), - 'identifier' => new ObjectAccessorNode('some.identifier') - ] + 'identifier' => new ObjectAccessorNode('some.identifier'), + ], ]; yield 'Single quoted subarray with numerical keys' => [ @@ -519,8 +519,8 @@ public static function dataProviderRecursiveArrayHandler(): \Generator 'number' => 123, 234, new TextNode('some.string'), - new ObjectAccessorNode('some.identifier') - ] + new ObjectAccessorNode('some.identifier'), + ], ]; yield 'Nested subarray' => [ @@ -533,10 +533,10 @@ public static function dataProviderRecursiveArrayHandler(): \Generator 'array' => new ArrayNode([ 'number' => 123, 'string' => new TextNode('some.string'), - 'identifier' => new ObjectAccessorNode('some.identifier') - ]) - ]) - ] + 'identifier' => new ObjectAccessorNode('some.identifier'), + ]), + ]), + ], ]; yield 'Mixed types' => [ @@ -548,9 +548,9 @@ public static function dataProviderRecursiveArrayHandler(): \Generator 'array' => new ArrayNode([ 'number' => 123, 'string' => new TextNode('some.string'), - 'identifier' => new ObjectAccessorNode('some.identifier') - ]) - ] + 'identifier' => new ObjectAccessorNode('some.identifier'), + ]), + ], ]; $rootNode = new RootNode(); @@ -558,8 +558,8 @@ public static function dataProviderRecursiveArrayHandler(): \Generator yield 'variable identifier' => [ 'string' => 'variableIdentifier: \'{some.{index}}\'', 'expected' => [ - 'variableIdentifier' => $rootNode - ] + 'variableIdentifier' => $rootNode, + ], ]; $rootNode = new RootNode(); @@ -568,9 +568,9 @@ public static function dataProviderRecursiveArrayHandler(): \Generator 'string' => 'array: {variableIdentifier: \'{some.{index}}\'}', 'expected' => [ 'array' => new ArrayNode([ - 'variableIdentifier' => $rootNode - ]) - ] + 'variableIdentifier' => $rootNode, + ]), + ], ]; } @@ -602,7 +602,7 @@ public function abortIfRequiredArgumentsAreMissingThrowsException(): void $this->expectException(Exception::class); $expected = [ 'firstArgument' => new ArgumentDefinition('firstArgument', 'string', '', false), - 'secondArgument' => new ArgumentDefinition('secondArgument', 'string', '', true) + 'secondArgument' => new ArgumentDefinition('secondArgument', 'string', '', true), ]; $subject = new TemplateParser(); $method = new \ReflectionMethod($subject, 'abortIfRequiredArgumentsAreMissing'); @@ -616,10 +616,10 @@ public function abortIfRequiredArgumentsAreMissingDoesNotThrowExceptionIfRequire { $expectedArguments = [ 'name1' => new ArgumentDefinition('name1', 'string', 'desc', false), - 'name2' => new ArgumentDefinition('name2', 'string', 'desc', true) + 'name2' => new ArgumentDefinition('name2', 'string', 'desc', true), ]; $actualArguments = [ - 'name2' => 'bla' + 'name2' => 'bla', ]; $subject = new TemplateParser(); $method = new \ReflectionMethod($subject, 'abortIfRequiredArgumentsAreMissing'); @@ -635,7 +635,7 @@ public function booleanArgumentsMustBeConvertedIntoBooleanNodes(): void { $argumentDefinitions = [ 'var1' => new ArgumentDefinition('var1', 'bool', 'desc', false), - 'var2' => new ArgumentDefinition('var2', 'boolean', 'desc', false) + 'var2' => new ArgumentDefinition('var2', 'boolean', 'desc', false), ]; $viewHelper = $this->createMock(CommentViewHelper::class); $resolver = $this->createMock(ViewHelperResolver::class); @@ -649,9 +649,9 @@ public function booleanArgumentsMustBeConvertedIntoBooleanNodes(): void self::assertEquals( [ 'var1' => new BooleanNode(new NumericNode(1)), - 'var2' => new BooleanNode(new NumericNode(0)) + 'var2' => new BooleanNode(new NumericNode(0)), ], - $parsedArguments + $parsedArguments, ); } } diff --git a/tests/Unit/Core/Parser/TemplateProcessor/EscapingModifierTemplateProcessorTest.php b/tests/Unit/Core/Parser/TemplateProcessor/EscapingModifierTemplateProcessorTest.php index e7868b578..04086d175 100644 --- a/tests/Unit/Core/Parser/TemplateProcessor/EscapingModifierTemplateProcessorTest.php +++ b/tests/Unit/Core/Parser/TemplateProcessor/EscapingModifierTemplateProcessorTest.php @@ -32,7 +32,7 @@ public static function getEscapingTestValues(): array ['{escapingEnabled=on}', true], ['{escapingEnabled off}', false], ['{escapingEnabled = off}', false], - ['{escapingEnabled=off}', false] + ['{escapingEnabled=off}', false], ]; } @@ -66,7 +66,7 @@ public static function getErrorTestValues(): array '{escaping off}' . PHP_EOL . '{escaping off}', '{escaping off}' . PHP_EOL . '{escaping true}', '{escaping off}' . PHP_EOL . '{escaping false}', - ] + ], ]; } diff --git a/tests/Unit/Core/Rendering/RenderingContextTest.php b/tests/Unit/Core/Rendering/RenderingContextTest.php index 9e24bec79..436967174 100644 --- a/tests/Unit/Core/Rendering/RenderingContextTest.php +++ b/tests/Unit/Core/Rendering/RenderingContextTest.php @@ -57,7 +57,7 @@ public static function gettersReturnPreviouslySetObjectsDataProvider(): array ['cache', SimpleFileCache::class], ['templateParser', TemplateParser::class], ['templateCompiler', TemplateCompiler::class], - ['viewHelperVariableContainer', ViewHelperVariableContainer::class] + ['viewHelperVariableContainer', ViewHelperVariableContainer::class], ]; } diff --git a/tests/Unit/Core/Variables/StandardVariableProviderTest.php b/tests/Unit/Core/Variables/StandardVariableProviderTest.php index e51a2580f..e6ccfb121 100644 --- a/tests/Unit/Core/Variables/StandardVariableProviderTest.php +++ b/tests/Unit/Core/Variables/StandardVariableProviderTest.php @@ -212,169 +212,169 @@ public static function getPathTestValues(): array return [ 'access string variable' => [ [ - 'foo' => 'bar' + 'foo' => 'bar', ], 'foo', - 'bar' + 'bar', ], 'access not existing sub array on string value returns null' => [ [ - 'foo' => 'bar' + 'foo' => 'bar', ], 'foo.invalid', - null + null, ], 'access object getter' => [ [ - 'user' => new StandardVariableProviderModelFixture('Foobar Name') + 'user' => new StandardVariableProviderModelFixture('Foobar Name'), ], 'user.name', - 'Foobar Name' + 'Foobar Name', ], 'access object getter that returns empty string' => [ [ - 'user' => new StandardVariableProviderModelFixture('') + 'user' => new StandardVariableProviderModelFixture(''), ], 'user.name', - '' + '', ], 'access object isser' => [ [ - 'user' => new StandardVariableProviderModelFixture('Foobar Name') + 'user' => new StandardVariableProviderModelFixture('Foobar Name'), ], 'user.named', - true + true, ], 'access object isser that returns false' => [ [ - 'user' => new StandardVariableProviderModelFixture('') + 'user' => new StandardVariableProviderModelFixture(''), ], 'user.named', - false + false, ], 'access object hasser' => [ [ - 'user' => new StandardVariableProviderModelFixture('Foobar Name') + 'user' => new StandardVariableProviderModelFixture('Foobar Name'), ], 'user.someName', - true + true, ], 'access object hasser that returns false' => [ [ - 'user' => new StandardVariableProviderModelFixture('') + 'user' => new StandardVariableProviderModelFixture(''), ], 'user.someName', - false + false, ], 'access public object property' => [ [ - 'user' => new StandardVariableProviderModelFixture('') + 'user' => new StandardVariableProviderModelFixture(''), ], 'user.existingPublicProperty', - 'existingPublicPropertyValue' + 'existingPublicPropertyValue', ], 'access not existing object detail returns null' => [ [ - 'user' => new StandardVariableProviderModelFixture('') + 'user' => new StandardVariableProviderModelFixture(''), ], 'user.invalid', - null + null, ], 'access dynamic variable using invalid variable reference' => [ [], '{invalid}', - null + null, ], 'access dynamic variable using invalid sub variable reference' => [ [], '{{invalid}}', - null + null, ], 'access dynamic variable using invalid variable reference in string' => [ [], 'foo{invalid}bar', - null + null, ], 'access dynamic variable using invalid sub variable reference in string' => [ [], 'foo{{invalid}}bar', - null + null, ], 'access dynamic variable using invalid variable reference in dotted string' => [ [], 'foo.{invalid}.bar', - null + null, ], 'access dynamic variable using invalid sub variable reference in dotted string' => [ [], 'foo.{{invalid}}.bar', - null + null, ], 'access dynamic variable using variable reference' => [ [ 'foodynamicbar' => 'test', - 'dyn' => 'dynamic' + 'dyn' => 'dynamic', ], 'foo{dyn}bar', - 'test' + 'test', ], 'access dynamic variable using variable reference that resolves to zero' => [ [ 'foo' => [ - 0 => 'bar' + 0 => 'bar', ], - 'dynamic' => 0 + 'dynamic' => 0, ], 'foo.{dynamic}', - 'bar' + 'bar', ], 'access dynamic variable with dotted path using variable reference' => [ [ 'foo' => [ 'dynamic' => [ - 'bar' => 'test' - ] + 'bar' => 'test', + ], ], - 'dyn' => 'dynamic' + 'dyn' => 'dynamic', ], 'foo.{dyn}.bar', - 'test' + 'test', ], 'access nested dynamic variable with dotted path using double sub variable reference' => [ [ 'foo' => [ - 'sub2' => 'test' + 'sub2' => 'test', ], 'baz' => 'sub1', - 'sub1' => 'sub2' + 'sub1' => 'sub2', ], 'foo.{{baz}}', - 'test' + 'test', ], 'access nested dynamic variable with dotted path using triple sub variable reference' => [ [ 'foo' => [ - 'sub3' => 'test' + 'sub3' => 'test', ], 'baz' => 'sub1', 'sub1' => 'sub2', - 'sub2' => 'sub3' + 'sub2' => 'sub3', ], 'foo.{{{baz}}}', - 'test' + 'test', ], 'access nested dynamic variable with dotted path using sub variable reference' => [ [ 'foo' => [ - 'bar' => 'test' + 'bar' => 'test', ], 'dynamic' => [ - 'sub' => 'bar' + 'sub' => 'bar', ], - 'baz' => 'sub' + 'baz' => 'sub', ], 'foo.{dynamic.{baz}}', - 'test' + 'test', ], 'access nested dynamic variable with dotted path using sub variable reference and suffix' => [ [ @@ -384,12 +384,12 @@ public static function getPathTestValues(): array ], ], 'dynamic' => [ - 'dyn1' => 'bar' + 'dyn1' => 'bar', ], - 'baz' => 'dyn1' + 'baz' => 'dyn1', ], 'foo.{dynamic.{baz}}.baz', - 'test' + 'test', ], 'access nested dynamic variable with dotted path using sub variable reference and double suffix' => [ [ @@ -399,36 +399,36 @@ public static function getPathTestValues(): array ], ], 'dynamic' => [ - 'dyn1foo' => 'bar' + 'dyn1foo' => 'bar', ], - 'baz' => 'dyn1' + 'baz' => 'dyn1', ], 'foo.{dynamic.{baz}foo}.baz', - 'test' + 'test', ], 'access with multiple dynamic variables' => [ [ 'foodynamic1dynamic2' => 'test', 'dyn1' => 'dynamic1', - 'dyn2' => 'dynamic2' + 'dyn2' => 'dynamic2', ], 'foo{dyn1}{dyn2}', - 'test' + 'test', ], 'access with multiple dynamic variables and dotted path' => [ [ 'foo' => [ 'dynamic1' => [ 'dynamic2' => [ - 'bar' => 'test' - ] - ] + 'bar' => 'test', + ], + ], ], 'dyn1' => 'dynamic1', - 'dyn2' => 'dynamic2' + 'dyn2' => 'dynamic2', ], 'foo.{dyn1}.{dyn2}.bar', - 'test' + 'test', ], 'access with multiple nested dynamic variables and dotted path' => [ [ @@ -436,10 +436,10 @@ public static function getPathTestValues(): array 'dynamic1-1' => [ 'dynamic3-1dynamic4-1' => [ 'dynamic5-1' => [ - 'bar' => 'test' - ] - ] - ] + 'bar' => 'test', + ], + ], + ], ], 'dyn1' => [ 'dyn1-1' => 'dynamic1-1', @@ -450,10 +450,10 @@ public static function getPathTestValues(): array 'dyn5' => [ 'dyn5-1' => 'dynamic5-1', ], - 'dyn6' => 'dyn5-1' + 'dyn6' => 'dyn5-1', ], 'foo.{dyn1.{dyn2}}.{dyn3}{dyn4}.{dyn5.{dyn6}}.bar', - 'test' + 'test', ], ]; } diff --git a/tests/Unit/Core/ViewHelper/AbstractViewHelperTest.php b/tests/Unit/Core/ViewHelper/AbstractViewHelperTest.php index 4d41c8b9b..496f46a62 100644 --- a/tests/Unit/Core/ViewHelper/AbstractViewHelperTest.php +++ b/tests/Unit/Core/ViewHelper/AbstractViewHelperTest.php @@ -28,16 +28,16 @@ public static function getFirstElementOfNonEmptyTestValues(): array return [ 'plain array' => [ ['foo', 'bar'], - 'foo' + 'foo', ], 'iterator w/o arrayaccess' => [ new \IteratorIterator(new \ArrayIterator(['foo', 'bar'])), - 'foo' + 'foo', ], 'unsupported value' => [ 'unsupported value', - null - ] + null, + ], ]; } @@ -63,7 +63,7 @@ public function overrideArgumentOverwritesExistingArgumentDefinition(): void $method2 = new \ReflectionMethod($subject, 'overrideArgument'); $method2->invoke($subject, 'someName', 'integer', 'changed desc', true); $expected = [ - 'someName' => new ArgumentDefinition('someName', 'integer', 'changed desc', true) + 'someName' => new ArgumentDefinition('someName', 'integer', 'changed desc', true), ]; self::assertEquals($expected, $subject->prepareArguments()); } @@ -142,7 +142,7 @@ public static function validateArgumentsErrorsDataProvider(): array [new ArgumentDefinition('test', 'DateTime', '', true), 'test'], [new ArgumentDefinition('test', 'integer', '', true), new \ArrayIterator(['bar'])], [new ArgumentDefinition('test', 'object', '', true), 'test'], - [new ArgumentDefinition('test', 'string[]', '', true), [new \DateTime('now'), 'test']] + [new ArgumentDefinition('test', 'string[]', '', true), [new \DateTime('now'), 'test']], ]; } diff --git a/tests/Unit/Core/ViewHelper/ViewHelperResolverTest.php b/tests/Unit/Core/ViewHelper/ViewHelperResolverTest.php index e6c1ebeb2..cf0aaa682 100644 --- a/tests/Unit/Core/ViewHelper/ViewHelperResolverTest.php +++ b/tests/Unit/Core/ViewHelper/ViewHelperResolverTest.php @@ -107,7 +107,7 @@ public static function isNamespaceValidReturnsExpectedValueDataProvider(): array [['foo' => ['test']], 'foo', true], [['foo' => ['test']], 'foobar', false], [['foo*' => null], 'foo', false], - [[], 'invalid', false] + [[], 'invalid', false], ]; } diff --git a/tests/Unit/View/AbstractTemplateViewTest.php b/tests/Unit/View/AbstractTemplateViewTest.php index aa65dd097..921d16da9 100644 --- a/tests/Unit/View/AbstractTemplateViewTest.php +++ b/tests/Unit/View/AbstractTemplateViewTest.php @@ -133,7 +133,7 @@ public function assignMultipleCanOverridePreviouslyAssignedValues(): void $series = [ ['foo', 'FooValue'], ['foo', 'FooValueOverridden'], - ['bar', 'BarValue'] + ['bar', 'BarValue'], ]; $variableProvider->expects(self::exactly(3))->method('add')->willReturnCallback(function (...$args) use (&$series): void { [$expectedArgOne, $expectedArgTwo] = array_shift($series); diff --git a/tests/Unit/View/TemplatePathsTest.php b/tests/Unit/View/TemplatePathsTest.php index 7a2121b07..04222325f 100644 --- a/tests/Unit/View/TemplatePathsTest.php +++ b/tests/Unit/View/TemplatePathsTest.php @@ -27,7 +27,7 @@ public static function sanitizePathDataProvider(): array ['composer.json', strtr(getcwd(), '\\', '/') . '/composer.json'], ['php://stdin', 'php://stdin'], ['foo://bar/baz', ''], - ['file://foo/bar/baz', 'file://foo/bar/baz'] + ['file://foo/bar/baz', 'file://foo/bar/baz'], ]; } @@ -79,7 +79,7 @@ public static function getGetterAndSetterTestValues(): array return [ ['layoutRootPaths', ['foo' => 'bar']], ['templateRootPaths', ['foo' => 'bar']], - ['partialRootPaths', ['foo' => 'bar']] + ['partialRootPaths', ['foo' => 'bar']], ]; } @@ -115,7 +115,7 @@ public function testFillByConfigurationArray(): void TemplatePaths::CONFIG_TEMPLATEROOTPATHS => ['Resources/Private/Templates/'], TemplatePaths::CONFIG_LAYOUTROOTPATHS => ['Resources/Private/Layouts/'], TemplatePaths::CONFIG_PARTIALROOTPATHS => ['Resources/Private/Partials/'], - TemplatePaths::CONFIG_FORMAT => 'xml' + TemplatePaths::CONFIG_FORMAT => 'xml', ]); self::assertNotEmpty($instance->getTemplateRootPaths()); } @@ -125,7 +125,7 @@ public static function getResolveFilesMethodTestValues(): array return [ ['resolveAvailableTemplateFiles', 'setTemplateRootPaths'], ['resolveAvailablePartialFiles', 'setPartialRootPaths'], - ['resolveAvailableLayoutFiles', 'setLayoutRootPaths'] + ['resolveAvailableLayoutFiles', 'setLayoutRootPaths'], ]; } @@ -155,7 +155,7 @@ public function testToArray(): void $expected = [ TemplatePaths::CONFIG_TEMPLATEROOTPATHS => [1], TemplatePaths::CONFIG_LAYOUTROOTPATHS => [2], - TemplatePaths::CONFIG_PARTIALROOTPATHS => [3] + TemplatePaths::CONFIG_PARTIALROOTPATHS => [3], ]; self::assertEquals($expected, $result); } @@ -178,7 +178,7 @@ public function testResolveFilesInFolders(): void sort($expected); self::assertSame( $expected, - $result + $result, ); }