diff --git a/Neos.Cache/Classes/Backend/AbstractBackend.php b/Neos.Cache/Classes/Backend/AbstractBackend.php index b6ea0aa72c..a91bcbb19f 100644 --- a/Neos.Cache/Classes/Backend/AbstractBackend.php +++ b/Neos.Cache/Classes/Backend/AbstractBackend.php @@ -1,4 +1,5 @@ environmentConfiguration = $environmentConfiguration; @@ -144,7 +145,7 @@ public function setDefaultLifetime($defaultLifetime): void * @param integer $lifetime The lifetime in seconds * @return \DateTime The expiry time */ - protected function calculateExpiryTime(int $lifetime = null): \DateTime + protected function calculateExpiryTime(?int $lifetime = null): \DateTime { if ($lifetime === self::UNLIMITED_LIFETIME || ($lifetime === null && $this->defaultLifetime === self::UNLIMITED_LIFETIME)) { return new \DateTime(self::DATETIME_EXPIRYTIME_UNLIMITED, new \DateTimeZone('UTC')); diff --git a/Neos.Cache/Classes/Backend/ApcuBackend.php b/Neos.Cache/Classes/Backend/ApcuBackend.php index 8b5524eb75..b44d256cc8 100644 --- a/Neos.Cache/Classes/Backend/ApcuBackend.php +++ b/Neos.Cache/Classes/Backend/ApcuBackend.php @@ -1,4 +1,5 @@ cache instanceof FrontendInterface) { throw new Exception('No cache frontend has been set yet via setCache().', 1232986818); diff --git a/Neos.Cache/Classes/Backend/BackendInterface.php b/Neos.Cache/Classes/Backend/BackendInterface.php index a7929913cf..6401f40df4 100644 --- a/Neos.Cache/Classes/Backend/BackendInterface.php +++ b/Neos.Cache/Classes/Backend/BackendInterface.php @@ -1,4 +1,5 @@ cacheEntryFileExtension); - return $cacheEntryFileExtensionLength === 0 ? $filename : substr($filename, 0, - strlen($this->cacheEntryFileExtension)); + return $cacheEntryFileExtensionLength === 0 ? $filename : substr($filename, 0, -strlen($this->cacheEntryFileExtension)); } } diff --git a/Neos.Cache/Classes/Backend/MemcachedBackend.php b/Neos.Cache/Classes/Backend/MemcachedBackend.php index dacf7ce832..56ba96cd46 100644 --- a/Neos.Cache/Classes/Backend/MemcachedBackend.php +++ b/Neos.Cache/Classes/Backend/MemcachedBackend.php @@ -1,4 +1,5 @@ getPrefixedIdentifier($entryIdentifier)) > 250) { throw new \InvalidArgumentException('Could not set value. Key more than 250 characters (' . $this->getPrefixedIdentifier($entryIdentifier) . ').', 1232969508); diff --git a/Neos.Cache/Classes/Backend/MultiBackend.php b/Neos.Cache/Classes/Backend/MultiBackend.php index 0346da13bf..55bf2f9d14 100644 --- a/Neos.Cache/Classes/Backend/MultiBackend.php +++ b/Neos.Cache/Classes/Backend/MultiBackend.php @@ -1,4 +1,5 @@ prepareBackends(); foreach ($this->backends as $backend) { diff --git a/Neos.Cache/Classes/Backend/NullBackend.php b/Neos.Cache/Classes/Backend/NullBackend.php index 3cce970fde..a8ec3087b1 100644 --- a/Neos.Cache/Classes/Backend/NullBackend.php +++ b/Neos.Cache/Classes/Backend/NullBackend.php @@ -1,4 +1,5 @@ connect(); @@ -406,7 +407,7 @@ public function flushByTags(array $tags): int $statementHandle = $this->databaseHandle->prepare('SELECT "identifier" FROM "' . $this->tagsTableName . '" WHERE "context"=? AND "cache"=? AND "tag" IN (' . $tagPlaceholders . ')'); $statementHandle->execute(array_merge([$this->context(), $this->cacheIdentifier], $tagList)); $result = $statementHandle->fetchAll(); - $identifiers[]= array_column($result, 'identifier'); + $identifiers[] = array_column($result, 'identifier'); } $identifiers = array_merge([], ...$identifiers); diff --git a/Neos.Cache/Classes/Backend/RedisBackend.php b/Neos.Cache/Classes/Backend/RedisBackend.php index 27639ed7a2..bc6ec772f2 100644 --- a/Neos.Cache/Classes/Backend/RedisBackend.php +++ b/Neos.Cache/Classes/Backend/RedisBackend.php @@ -1,4 +1,5 @@ isFrozen()) { throw new \RuntimeException(sprintf('Cannot add or modify cache entry because the backend of cache "%s" is frozen.', $this->cacheIdentifier), 1323344192); @@ -493,7 +494,7 @@ public function setBatchSize(int|string $batchSize): void $this->batchSize = (int)$batchSize; } - public function setRedis(\Redis $redis = null): void + public function setRedis(?\Redis $redis = null): void { if ($redis !== null) { $this->redis = $redis; diff --git a/Neos.Cache/Classes/Backend/SimpleFileBackend.php b/Neos.Cache/Classes/Backend/SimpleFileBackend.php index c0173326ef..b3909dc959 100644 --- a/Neos.Cache/Classes/Backend/SimpleFileBackend.php +++ b/Neos.Cache/Classes/Backend/SimpleFileBackend.php @@ -1,4 +1,5 @@ cache instanceof FrontendInterface) { throw new Exception('No cache frontend has been set yet via setCache().', 1238244992); diff --git a/Neos.Cache/Classes/Frontend/FrontendInterface.php b/Neos.Cache/Classes/Frontend/FrontendInterface.php index 8de9127f6c..974f719d9c 100644 --- a/Neos.Cache/Classes/Frontend/FrontendInterface.php +++ b/Neos.Cache/Classes/Frontend/FrontendInterface.php @@ -1,4 +1,5 @@ isValidEntryIdentifier($entryIdentifier)) { throw new \InvalidArgumentException('"' . $entryIdentifier . '" is not a valid cache entry identifier.', 1264023823); diff --git a/Neos.Cache/Classes/Frontend/StringFrontend.php b/Neos.Cache/Classes/Frontend/StringFrontend.php index 6d0a33568d..4aee2d2128 100644 --- a/Neos.Cache/Classes/Frontend/StringFrontend.php +++ b/Neos.Cache/Classes/Frontend/StringFrontend.php @@ -1,4 +1,5 @@ isValidEntryIdentifier($entryIdentifier)) { throw new \InvalidArgumentException('"' . $entryIdentifier . '" is not a valid cache entry identifier.', 1233057566); diff --git a/Neos.Cache/Classes/Frontend/VariableFrontend.php b/Neos.Cache/Classes/Frontend/VariableFrontend.php index 6498f081b8..1aec45d21e 100644 --- a/Neos.Cache/Classes/Frontend/VariableFrontend.php +++ b/Neos.Cache/Classes/Frontend/VariableFrontend.php @@ -1,4 +1,5 @@ isValidEntryIdentifier($entryIdentifier)) { throw new \InvalidArgumentException('"' . $entryIdentifier . '" is not a valid cache entry identifier.', 1233058264); diff --git a/Neos.Cache/Classes/Psr/SimpleCache/SimpleCache.php b/Neos.Cache/Classes/Psr/SimpleCache/SimpleCache.php index 61ee172b06..6540c4fd82 100644 --- a/Neos.Cache/Classes/Psr/SimpleCache/SimpleCache.php +++ b/Neos.Cache/Classes/Psr/SimpleCache/SimpleCache.php @@ -1,4 +1,5 @@ mockEnvironmentConfiguration, $options); diff --git a/Neos.Eel/Classes/Helper/ArrayHelper.php b/Neos.Eel/Classes/Helper/ArrayHelper.php index 49f4615489..ad7936a75b 100644 --- a/Neos.Eel/Classes/Helper/ArrayHelper.php +++ b/Neos.Eel/Classes/Helper/ArrayHelper.php @@ -562,7 +562,7 @@ public function reduce(iterable $array, callable $callback, $initialValue = null * @param callable $callback Callback for testing if an element should be included in the result, current value and key will be passed as arguments * @return array The array with elements where callback returned true */ - public function filter(iterable $array, callable $callback = null): array + public function filter(iterable $array, ?callable $callback = null): array { if ($array instanceof \Traversable) { $array = iterator_to_array($array); diff --git a/Neos.Error.Messages/Classes/Result.php b/Neos.Error.Messages/Classes/Result.php index 53caced03e..4d5123e1c9 100644 --- a/Neos.Error.Messages/Classes/Result.php +++ b/Neos.Error.Messages/Classes/Result.php @@ -1,4 +1,5 @@ * @api */ - public function getErrors(string $messageTypeFilter = null): array + public function getErrors(?string $messageTypeFilter = null): array { return $this->filterMessages($this->errors, $messageTypeFilter); } @@ -144,7 +145,7 @@ public function getErrors(string $messageTypeFilter = null): array * @return array * @api */ - public function getWarnings(string $messageTypeFilter = null): array + public function getWarnings(?string $messageTypeFilter = null): array { return $this->filterMessages($this->warnings, $messageTypeFilter); } @@ -156,7 +157,7 @@ public function getWarnings(string $messageTypeFilter = null): array * @return array * @api */ - public function getNotices(string $messageTypeFilter = null): array + public function getNotices(?string $messageTypeFilter = null): array { return $this->filterMessages($this->notices, $messageTypeFilter); } @@ -168,7 +169,7 @@ public function getNotices(string $messageTypeFilter = null): array * @return Error * @api */ - public function getFirstError(string $messageTypeFilter = null) + public function getFirstError(?string $messageTypeFilter = null) { $matchingErrors = $this->filterMessages($this->errors, $messageTypeFilter); reset($matchingErrors); @@ -182,7 +183,7 @@ public function getFirstError(string $messageTypeFilter = null) * @return Warning * @api */ - public function getFirstWarning(string $messageTypeFilter = null) + public function getFirstWarning(?string $messageTypeFilter = null) { $matchingWarnings = $this->filterMessages($this->warnings, $messageTypeFilter); reset($matchingWarnings); @@ -196,7 +197,7 @@ public function getFirstWarning(string $messageTypeFilter = null) * @return Notice * @api */ - public function getFirstNotice(string $messageTypeFilter = null) + public function getFirstNotice(?string $messageTypeFilter = null) { $matchingNotices = $this->filterMessages($this->notices, $messageTypeFilter); reset($matchingNotices); @@ -213,7 +214,7 @@ public function getFirstNotice(string $messageTypeFilter = null) * @return Result * @api */ - public function forProperty(string $propertyPath = null): Result + public function forProperty(?string $propertyPath = null): Result { if ($propertyPath === '' || $propertyPath === null) { return $this; @@ -410,7 +411,7 @@ public function getFlattenedNotices(): array * @param string $messageTypeFilter If specified only messages implementing the given class name are taken into account * @return void */ - public function flattenTree(string $propertyName, array &$result, array $level = [], string $messageTypeFilter = null) + public function flattenTree(string $propertyName, array &$result, array $level = [], ?string $messageTypeFilter = null) { if (count($this->$propertyName) > 0) { $propertyPath = implode('.', $level); @@ -429,7 +430,7 @@ public function flattenTree(string $propertyName, array &$result, array $level = * @param string $messageTypeFilter If specified only messages implementing the given class name are taken into account * @return array the filtered message instances */ - protected function filterMessages(array $messages, string $messageTypeFilter = null): array + protected function filterMessages(array $messages, ?string $messageTypeFilter = null): array { if ($messageTypeFilter === null) { return $messages; diff --git a/Neos.Flow.Log/Classes/Backend/AnsiConsoleBackend.php b/Neos.Flow.Log/Classes/Backend/AnsiConsoleBackend.php index 4c8fb9979b..f995308871 100644 --- a/Neos.Flow.Log/Classes/Backend/AnsiConsoleBackend.php +++ b/Neos.Flow.Log/Classes/Backend/AnsiConsoleBackend.php @@ -1,4 +1,5 @@ $this->severityThreshold) { return; diff --git a/Neos.Flow.Log/Classes/Backend/BackendInterface.php b/Neos.Flow.Log/Classes/Backend/BackendInterface.php index 6ef8f3c933..61fbe4c914 100644 --- a/Neos.Flow.Log/Classes/Backend/BackendInterface.php +++ b/Neos.Flow.Log/Classes/Backend/BackendInterface.php @@ -1,4 +1,5 @@ $this->severityThreshold) { return; diff --git a/Neos.Flow.Log/Classes/Backend/FileBackend.php b/Neos.Flow.Log/Classes/Backend/FileBackend.php index f959a6fb94..cf3f171baf 100644 --- a/Neos.Flow.Log/Classes/Backend/FileBackend.php +++ b/Neos.Flow.Log/Classes/Backend/FileBackend.php @@ -1,4 +1,5 @@ $this->severityThreshold) { return; diff --git a/Neos.Flow.Log/Classes/Backend/JsonFileBackend.php b/Neos.Flow.Log/Classes/Backend/JsonFileBackend.php index 8484ebdfb3..2914ec764d 100644 --- a/Neos.Flow.Log/Classes/Backend/JsonFileBackend.php +++ b/Neos.Flow.Log/Classes/Backend/JsonFileBackend.php @@ -1,4 +1,5 @@ $this->severityThreshold) { diff --git a/Neos.Flow.Log/Classes/Backend/NullBackend.php b/Neos.Flow.Log/Classes/Backend/NullBackend.php index 71463bcb7f..449e51b285 100644 --- a/Neos.Flow.Log/Classes/Backend/NullBackend.php +++ b/Neos.Flow.Log/Classes/Backend/NullBackend.php @@ -1,4 +1,5 @@ backendClassName . ' extends \Neos\Flow\Log\Backend\AbstractBackend { public function open(): void {} - public function append(string $message, int $severity = 1, $additionalData = NULL, string $packageKey = NULL, string $className = NULL, string $methodName = NULL): void {} + public function append(string $message, int $severity = 1, $additionalData = NULL, string $packageKey = NULL, string $className = NULL, ?string $methodName = NULL): void {} public function close(): void {} public function setSomeOption($value) { $this->someOption = $value; diff --git a/Neos.Flow/Classes/Annotations/IgnoreValidation.php b/Neos.Flow/Classes/Annotations/IgnoreValidation.php index a3d3d8eeb9..656cc48c6d 100644 --- a/Neos.Flow/Classes/Annotations/IgnoreValidation.php +++ b/Neos.Flow/Classes/Annotations/IgnoreValidation.php @@ -1,4 +1,5 @@ argumentName = $argumentName ? ltrim($argumentName, '$') : null; $this->evaluate = $evaluate; diff --git a/Neos.Flow/Classes/Annotations/Validate.php b/Neos.Flow/Classes/Annotations/Validate.php index 9f85537924..b6b580f622 100644 --- a/Neos.Flow/Classes/Annotations/Validate.php +++ b/Neos.Flow/Classes/Annotations/Validate.php @@ -1,4 +1,5 @@ type = $type; diff --git a/Neos.Flow/Classes/Aop/Advice/AbstractAdvice.php b/Neos.Flow/Classes/Aop/Advice/AbstractAdvice.php index 89d6615b40..8841b92b57 100644 --- a/Neos.Flow/Classes/Aop/Advice/AbstractAdvice.php +++ b/Neos.Flow/Classes/Aop/Advice/AbstractAdvice.php @@ -1,4 +1,5 @@ aspectObjectName = $aspectObjectName; $this->adviceMethodName = $adviceMethodName; diff --git a/Neos.Flow/Classes/Aop/Builder/AbstractMethodInterceptorBuilder.php b/Neos.Flow/Classes/Aop/Builder/AbstractMethodInterceptorBuilder.php index 714890e2a6..e6b204a089 100644 --- a/Neos.Flow/Classes/Aop/Builder/AbstractMethodInterceptorBuilder.php +++ b/Neos.Flow/Classes/Aop/Builder/AbstractMethodInterceptorBuilder.php @@ -1,4 +1,5 @@ buildMethodArgumentsArrayCode($declaringClassName, $methodName, ($methodName === '__construct')); diff --git a/Neos.Flow/Classes/Aop/JoinPoint.php b/Neos.Flow/Classes/Aop/JoinPoint.php index 1ee438a8c8..68d298ad2f 100644 --- a/Neos.Flow/Classes/Aop/JoinPoint.php +++ b/Neos.Flow/Classes/Aop/JoinPoint.php @@ -1,4 +1,5 @@ proxy = $proxy; $this->className = $className; diff --git a/Neos.Flow/Classes/Aop/Pointcut/Pointcut.php b/Neos.Flow/Classes/Aop/Pointcut/Pointcut.php index 7b040fdfa0..b973004047 100644 --- a/Neos.Flow/Classes/Aop/Pointcut/Pointcut.php +++ b/Neos.Flow/Classes/Aop/Pointcut/Pointcut.php @@ -1,4 +1,5 @@ pointcutExpression = $pointcutExpression; $this->pointcutFilterComposite = $pointcutFilterComposite; @@ -93,7 +94,7 @@ public function __construct(string $pointcutExpression, PointcutFilterComposite public function matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier): bool { if ($this->pointcutQueryIdentifier === $pointcutQueryIdentifier) { - $this->recursionLevel ++; + $this->recursionLevel++; if ($this->recursionLevel > self::MAXIMUM_RECURSIONS) { throw new CircularPointcutReferenceException('Circular pointcut reference detected in ' . $this->aspectClassName . '->' . $this->pointcutMethodName . ', too many recursions (Query identifier: ' . $pointcutQueryIdentifier . ').', 1172416172); } diff --git a/Neos.Flow/Classes/Aop/Pointcut/PointcutMethodNameFilter.php b/Neos.Flow/Classes/Aop/Pointcut/PointcutMethodNameFilter.php index bee5c15c7b..365cdde624 100644 --- a/Neos.Flow/Classes/Aop/Pointcut/PointcutMethodNameFilter.php +++ b/Neos.Flow/Classes/Aop/Pointcut/PointcutMethodNameFilter.php @@ -1,4 +1,5 @@ methodNameFilterExpression = $methodNameFilterExpression; if ($methodVisibility !== null && preg_match(self::PATTERN_MATCHVISIBILITYMODIFIER, $methodVisibility) !== 1) { diff --git a/Neos.Flow/Classes/Cli/CommandController.php b/Neos.Flow/Classes/Cli/CommandController.php index d6e509f26e..5db82c19b2 100644 --- a/Neos.Flow/Classes/Cli/CommandController.php +++ b/Neos.Flow/Classes/Cli/CommandController.php @@ -1,4 +1,5 @@ request->setDispatched(false); $this->request->setControllerCommandName($commandName); diff --git a/Neos.Flow/Classes/Cli/ConsoleOutput.php b/Neos.Flow/Classes/Cli/ConsoleOutput.php index 8fb93661a4..8268fc18b1 100644 --- a/Neos.Flow/Classes/Cli/ConsoleOutput.php +++ b/Neos.Flow/Classes/Cli/ConsoleOutput.php @@ -1,4 +1,5 @@ getTable(); if ($headers !== null) { @@ -164,7 +165,7 @@ public function outputTable(array $rows, array $headers = null, string $headerTi * @return integer|string|array Either the value for indexed arrays, the key for associative arrays or an array for multiple selections * @throws \InvalidArgumentException */ - public function select($question, array $choices, $default = null, bool $multiSelect = false, int $attempts = null) + public function select($question, array $choices, $default = null, bool $multiSelect = false, ?int $attempts = null) { $question = new ChoiceQuestion($this->combineQuestion($question), $choices, $default); $question @@ -183,7 +184,7 @@ public function select($question, array $choices, $default = null, bool $multiSe * @return mixed The user answer * @throws \RuntimeException If there is no data to read in the input stream */ - public function ask($question, string $default = null) + public function ask($question, ?string $default = null) { $question = new Question($this->combineQuestion($question), $default); @@ -251,7 +252,7 @@ public function askHiddenResponse($question, bool $fallback = true) * @return mixed The response * @throws \Exception When any of the validators return an error */ - public function askAndValidate($question, callable $validator, int $attempts = null, string $default = null) + public function askAndValidate($question, callable $validator, int $attempts = null, ?string $default = null) { $question = new Question($this->combineQuestion($question), $default); $question @@ -276,7 +277,7 @@ public function askAndValidate($question, callable $validator, int $attempts = n * @throws \Exception When any of the validators return an error * @throws \RuntimeException In case the fallback is deactivated and the response can not be hidden */ - public function askHiddenResponseAndValidate($question, callable $validator, int $attempts = null, bool $fallback = true) + public function askHiddenResponseAndValidate($question, callable $validator, ?int $attempts = null, bool $fallback = true) { $question = new Question($this->combineQuestion($question)); $question @@ -294,7 +295,7 @@ public function askHiddenResponseAndValidate($question, callable $validator, int * @param integer $max Maximum steps. If NULL an indeterminate progress bar is rendered * @return void */ - public function progressStart(int $max = null): void + public function progressStart(?int $max = null): void { $this->getProgressBar()->start($max); } @@ -361,7 +362,7 @@ public function setInput(InputInterface $input): void /** * @return InputInterface */ - public function getInput():InputInterface + public function getInput(): InputInterface { return $this->input; } diff --git a/Neos.Flow/Classes/Command/CacheCommandController.php b/Neos.Flow/Classes/Command/CacheCommandController.php index 776753b21d..265284927f 100644 --- a/Neos.Flow/Classes/Command/CacheCommandController.php +++ b/Neos.Flow/Classes/Command/CacheCommandController.php @@ -1,4 +1,5 @@ cacheManager->getCache($cacheIdentifier); diff --git a/Neos.Flow/Classes/Command/ConfigurationCommandController.php b/Neos.Flow/Classes/Command/ConfigurationCommandController.php index 801b3aa6cc..b696923a3e 100644 --- a/Neos.Flow/Classes/Command/ConfigurationCommandController.php +++ b/Neos.Flow/Classes/Command/ConfigurationCommandController.php @@ -1,4 +1,5 @@ configurationManager->getAvailableConfigurationTypes(); if (in_array($type, $availableConfigurationTypes)) { @@ -125,7 +126,7 @@ public function listTypesCommand() * @param boolean $verbose if true, output more verbose information on the schema files which were used * @return void */ - public function validateCommand(string $type = null, string $path = null, bool $verbose = false) + public function validateCommand(string $type = null, ?string $path = null, bool $verbose = false) { if ($type === null) { $this->outputLine('Validating all configuration'); @@ -188,7 +189,7 @@ public function validateCommand(string $type = null, string $path = null, bool $ * @param string $yaml YAML file to create a schema for * @return void */ - public function generateSchemaCommand(string $type = null, string $path = null, string $yaml = null) + public function generateSchemaCommand(string $type = null, string $path = null, ?string $yaml = null) { $data = null; if ($yaml !== null && is_file($yaml) && is_readable($yaml)) { diff --git a/Neos.Flow/Classes/Command/CoreCommandController.php b/Neos.Flow/Classes/Command/CoreCommandController.php index b0e285267c..560166df34 100644 --- a/Neos.Flow/Classes/Command/CoreCommandController.php +++ b/Neos.Flow/Classes/Command/CoreCommandController.php @@ -1,4 +1,5 @@ persistenceSettings['backendOptions']['driver'], ['pdo_mysql', 'mysqli'])) { $this->outputLine('Database charset/collation fixing is only supported on MySQL.'); @@ -118,7 +119,7 @@ public function setCharsetCommand(string $characterSet = 'utf8mb4', string $coll * @throws ConnectionException * @throws DBALException */ - protected function convertToCharacterSetAndCollation(string $characterSet, string $collation, string $outputPathAndFilename = null, bool $verbose = false) + protected function convertToCharacterSetAndCollation(string $characterSet, string $collation, ?string $outputPathAndFilename = null, bool $verbose = false) { $statements = ['SET foreign_key_checks = 0']; diff --git a/Neos.Flow/Classes/Command/DoctrineCommandController.php b/Neos.Flow/Classes/Command/DoctrineCommandController.php index 899be0ea9f..fc03c53abd 100644 --- a/Neos.Flow/Classes/Command/DoctrineCommandController.php +++ b/Neos.Flow/Classes/Command/DoctrineCommandController.php @@ -1,4 +1,5 @@ isDatabaseConfigured()) { $this->outputLine('Database schema creation has been SKIPPED, the driver and host backend options are not set in /Configuration/Settings.yaml.'); @@ -173,7 +174,7 @@ public function createCommand(string $output = null): void * @see neos.flow:doctrine:create * @see neos.flow:doctrine:migrate */ - public function updateCommand(bool $unsafeMode = false, string $output = null): void + public function updateCommand(bool $unsafeMode = false, ?string $output = null): void { if (!$this->isDatabaseConfigured()) { $this->outputLine('Database schema update has been SKIPPED, the driver and host backend options are not set in /Configuration/Settings.yaml.'); @@ -202,7 +203,7 @@ public function updateCommand(bool $unsafeMode = false, string $output = null): * @throws \Doctrine\ORM\ORMException * @see neos.flow:doctrine:validate */ - public function entityStatusCommand(bool $dumpMappingData = false, string $entityClassName = null): void + public function entityStatusCommand(bool $dumpMappingData = false, ?string $entityClassName = null): void { $info = $this->doctrineService->getEntityStatus(); @@ -255,7 +256,7 @@ public function entityStatusCommand(bool $dumpMappingData = false, string $entit * @return void * @throws StopCommandException */ - public function dqlCommand(int $depth = 3, string $hydrationMode = 'array', int $offset = null, int $limit = null): void + public function dqlCommand(int $depth = 3, string $hydrationMode = 'array', int $offset = null, ?int $limit = null): void { if (!$this->isDatabaseConfigured()) { $this->outputLine('DQL query is not possible, the driver and host backend options are not set in /Configuration/Settings.yaml.'); @@ -316,7 +317,7 @@ public function migrationStatusCommand(bool $showMigrations = false): void * @see neos.flow:doctrine:migrationgenerate * @see neos.flow:doctrine:migrationversion */ - public function migrateCommand(string $version = 'latest', string $output = null, bool $dryRun = false, bool $quiet = false): void + public function migrateCommand(string $version = 'latest', ?string $output = null, bool $dryRun = false, bool $quiet = false): void { if (!$this->isDatabaseConfigured()) { $this->outputLine('Doctrine migration not possible, the driver and host backend options are not set in /Configuration/Settings.yaml.'); @@ -363,7 +364,7 @@ protected function emitAfterDatabaseMigration(): void * @see neos.flow:doctrine:migrationgenerate * @see neos.flow:doctrine:migrationversion */ - public function migrationExecuteCommand(string $version, string $direction = 'up', string $output = null, bool $dryRun = false): void + public function migrationExecuteCommand(string $version, string $direction = 'up', ?string $output = null, bool $dryRun = false): void { if (!$this->isDatabaseConfigured()) { $this->outputLine('Doctrine migration not possible, the driver and host backend options are not set in /Configuration/Settings.yaml.'); @@ -448,7 +449,7 @@ public function migrationVersionCommand(string $version, bool $add = false, bool * @see neos.flow:doctrine:migrationexecute * @see neos.flow:doctrine:migrationversion */ - public function migrationGenerateCommand(bool $diffAgainstCurrent = true, string $filterExpression = null, bool $force = false): void + public function migrationGenerateCommand(bool $diffAgainstCurrent = true, ?string $filterExpression = null, bool $force = false): void { if (!$this->isDatabaseConfigured()) { $this->outputLine('Doctrine migration generation has been SKIPPED, the driver and host backend options are not set in /Configuration/Settings.yaml.'); diff --git a/Neos.Flow/Classes/Command/HelpCommandController.php b/Neos.Flow/Classes/Command/HelpCommandController.php index 924c6670a8..50701a409a 100644 --- a/Neos.Flow/Classes/Command/HelpCommandController.php +++ b/Neos.Flow/Classes/Command/HelpCommandController.php @@ -1,4 +1,5 @@ request->getExceedingArguments(); if (count($exceedingArguments) > 0 && $commandIdentifier === null) { diff --git a/Neos.Flow/Classes/Command/ResourceCommandController.php b/Neos.Flow/Classes/Command/ResourceCommandController.php index dcb2ec7b95..37d48e9fc9 100644 --- a/Neos.Flow/Classes/Command/ResourceCommandController.php +++ b/Neos.Flow/Classes/Command/ResourceCommandController.php @@ -1,4 +1,5 @@ resourceRepository->findAllIterator(); - foreach ($this->resourceRepository->iterate($iterator, function ($iteration) { - $this->clearState($iteration); - }) as $resource) { + foreach ( + $this->resourceRepository->iterate($iterator, function ($iteration) { + $this->clearState($iteration); + }) as $resource + ) { $this->output->progressAdvance(1); /* @var PersistentResource $resource */ $stream = $resource->getStream(); diff --git a/Neos.Flow/Classes/Command/RoutingCommandController.php b/Neos.Flow/Classes/Command/RoutingCommandController.php index acb33fe95c..163b444a38 100644 --- a/Neos.Flow/Classes/Command/RoutingCommandController.php +++ b/Neos.Flow/Classes/Command/RoutingCommandController.php @@ -1,4 +1,5 @@ $package, @@ -266,7 +267,7 @@ public function routePathCommand(string $path, string $method = 'GET'): void * @param string|null $parameters Route parameters as JSON string. Make sure to specify this option as described in the description in order to prevent parsing issues * @throws InvalidRoutePartValueException | StopCommandException */ - public function matchCommand(string $uri, string $method = null, string $parameters = null): void + public function matchCommand(string $uri, string $method = null, ?string $parameters = null): void { $method = $method ?? 'GET'; $requestUri = new Uri($uri); diff --git a/Neos.Flow/Classes/Command/SchemaCommandController.php b/Neos.Flow/Classes/Command/SchemaCommandController.php index de65a5026a..8b4754d052 100644 --- a/Neos.Flow/Classes/Command/SchemaCommandController.php +++ b/Neos.Flow/Classes/Command/SchemaCommandController.php @@ -1,4 +1,5 @@ outputLine('Validating ' . $configurationFile . ' with schema ' . $schemaFile . ''); $this->outputLine(); diff --git a/Neos.Flow/Classes/Command/SignalCommandController.php b/Neos.Flow/Classes/Command/SignalCommandController.php index b6aa8d0749..7e3a6af01b 100644 --- a/Neos.Flow/Classes/Command/SignalCommandController.php +++ b/Neos.Flow/Classes/Command/SignalCommandController.php @@ -1,4 +1,5 @@ outputFormatted('Connected signals with their slots.'); $this->outputLine(); diff --git a/Neos.Flow/Classes/Command/TypeConverterCommandController.php b/Neos.Flow/Classes/Command/TypeConverterCommandController.php index c31b1bd079..7dd89d5e6c 100644 --- a/Neos.Flow/Classes/Command/TypeConverterCommandController.php +++ b/Neos.Flow/Classes/Command/TypeConverterCommandController.php @@ -1,4 +1,5 @@ outputLine(); if ($source !== null) { diff --git a/Neos.Flow/Classes/Composer/ComposerUtility.php b/Neos.Flow/Classes/Composer/ComposerUtility.php index 94cca5a9ab..cfbd1fcc67 100644 --- a/Neos.Flow/Classes/Composer/ComposerUtility.php +++ b/Neos.Flow/Classes/Composer/ComposerUtility.php @@ -1,4 +1,5 @@ configurations[$configurationType])) { $this->loadConfiguration($configurationType, $this->packages); @@ -468,7 +469,7 @@ protected function saveConfigurationCache(): void * * @param string $cachePathAndFilename The file to save the cache */ - protected function writeConfigurationCacheFile(string $cachePathAndFilename, string $configurationType = null): void + protected function writeConfigurationCacheFile(string $cachePathAndFilename, ?string $configurationType = null): void { if (!file_exists(dirname($cachePathAndFilename))) { Files::createDirectoryRecursively(dirname($cachePathAndFilename)); diff --git a/Neos.Flow/Classes/Configuration/ConfigurationSchemaValidator.php b/Neos.Flow/Classes/Configuration/ConfigurationSchemaValidator.php index ed24c65d13..01314b589a 100644 --- a/Neos.Flow/Classes/Configuration/ConfigurationSchemaValidator.php +++ b/Neos.Flow/Classes/Configuration/ConfigurationSchemaValidator.php @@ -1,4 +1,5 @@ configurationManager->getAvailableConfigurationTypes(); @@ -95,11 +96,11 @@ public function validate(string $configurationType = null, string $path = null, * @return \Neos\Error\Messages\Result * @throws Exception\SchemaValidationException */ - protected function validateSingleType(string $configurationType, string $path = null, array&$loadedSchemaFiles = []): Result + protected function validateSingleType(string $configurationType, ?string $path = null, array &$loadedSchemaFiles = []): Result { $availableConfigurationTypes = $this->configurationManager->getAvailableConfigurationTypes(); if (in_array($configurationType, $availableConfigurationTypes) === false) { - $message = (string)$this->translator->translateById('configuration.anErrorOccurredDuringValidationOfTheConfiguration.body', [$configurationType,implode('", "', $availableConfigurationTypes)], null, null, 'Main', 'Neos.Flow'); + $message = (string)$this->translator->translateById('configuration.anErrorOccurredDuringValidationOfTheConfiguration.body', [$configurationType, implode('", "', $availableConfigurationTypes)], null, null, 'Main', 'Neos.Flow'); throw new Exception\SchemaValidationException( $message, 1364984886 @@ -134,7 +135,7 @@ protected function validateSingleType(string $configurationType, string $path = } if (count($schemaFileInfos) === 0) { - throw new Exception\SchemaValidationException('No schema files found for configuration type "' . $configurationType . '"' . ($path !== null ? ' and path "' . $path . '".': '.'), 1364985056); + throw new Exception\SchemaValidationException('No schema files found for configuration type "' . $configurationType . '"' . ($path !== null ? ' and path "' . $path . '".' : '.'), 1364985056); } $result = new Result(); diff --git a/Neos.Flow/Classes/Core/Booting/Scripts.php b/Neos.Flow/Classes/Core/Booting/Scripts.php index c96c22c46b..62bf0cb5fc 100644 --- a/Neos.Flow/Classes/Core/Booting/Scripts.php +++ b/Neos.Flow/Classes/Core/Booting/Scripts.php @@ -1,4 +1,5 @@ monitorDirectory($path, $filenamePattern); @@ -901,9 +904,9 @@ protected static function ensureCLISubrequestsUseCurrentlyRunningPhpBinary($phpB if (strcmp($realPhpBinary, $configuredPhpBinaryPathAndFilename) !== 0) { throw new Exception\SubProcessException(sprintf( 'You are running the Flow CLI with a PHP binary different from the one Flow is configured to use internally. ' . - 'Flow has been run with "%s", while the PHP version Flow is configured to use for subrequests is "%s". Make sure to configure Flow to ' . - 'use the same PHP binary by setting the "Neos.Flow.core.phpBinaryPathAndFilename" configuration option to "%s". Flush the ' . - 'caches by removing the folder Data/Temporary before running ./flow again.', + 'Flow has been run with "%s", while the PHP version Flow is configured to use for subrequests is "%s". Make sure to configure Flow to ' . + 'use the same PHP binary by setting the "Neos.Flow.core.phpBinaryPathAndFilename" configuration option to "%s". Flush the ' . + 'caches by removing the folder Data/Temporary before running ./flow again.', $realPhpBinary, $configuredPhpBinaryPathAndFilename, $realPhpBinary @@ -963,9 +966,9 @@ protected static function ensureWebSubrequestsUseCurrentlyRunningPhpVersion($php if (!$versionsAlmostEqual($phpInformation['version'], PHP_VERSION)) { throw new FlowException(sprintf( 'You are executing Neos/Flow with a PHP version different from the one Flow is configured to use internally. ' . - 'Flow is running with with PHP "%s", while the PHP version Flow is configured to use for subrequests is "%s". Make sure to configure Flow to ' . - 'use the same PHP version by setting the "Neos.Flow.core.phpBinaryPathAndFilename" configuration option to a PHP-CLI binary of the version ' . - '%s. Flush the caches by removing the folder Data/Temporary before executing Flow/Neos again.', + 'Flow is running with with PHP "%s", while the PHP version Flow is configured to use for subrequests is "%s". Make sure to configure Flow to ' . + 'use the same PHP version by setting the "Neos.Flow.core.phpBinaryPathAndFilename" configuration option to a PHP-CLI binary of the version ' . + '%s. Flush the caches by removing the folder Data/Temporary before executing Flow/Neos again.', PHP_VERSION, $phpInformation['version'], PHP_VERSION diff --git a/Neos.Flow/Classes/Core/ProxyClassLoader.php b/Neos.Flow/Classes/Core/ProxyClassLoader.php index 601faccd4d..986d12a9bb 100644 --- a/Neos.Flow/Classes/Core/ProxyClassLoader.php +++ b/Neos.Flow/Classes/Core/ProxyClassLoader.php @@ -1,4 +1,5 @@ getConfiguredBaseUri(); if ($baseUri instanceof UriInterface) { diff --git a/Neos.Flow/Classes/Http/Helper/UploadedFilesHelper.php b/Neos.Flow/Classes/Http/Helper/UploadedFilesHelper.php index fc393bf47f..8fe327961d 100644 --- a/Neos.Flow/Classes/Http/Helper/UploadedFilesHelper.php +++ b/Neos.Flow/Classes/Http/Helper/UploadedFilesHelper.php @@ -1,4 +1,5 @@ getError() === UPLOAD_ERR_OK ? $uploadedFile->getStream() : Utils::streamFor(null); @@ -128,7 +129,7 @@ public static function untangleFilesArray(array $convolutedFiles): array * @param string $firstLevelFieldName * @return array An array of paths (as arrays) in the format ["key1", "key2", "key3"] ... */ - protected static function calculateFieldPathsAsArray(array $structure, string $firstLevelFieldName = null): array + protected static function calculateFieldPathsAsArray(array $structure, ?string $firstLevelFieldName = null): array { $fieldPaths = []; foreach ($structure as $key => $subStructure) { diff --git a/Neos.Flow/Classes/I18n/FormatResolver.php b/Neos.Flow/Classes/I18n/FormatResolver.php index 6a77ff2318..03a2e98129 100644 --- a/Neos.Flow/Classes/I18n/FormatResolver.php +++ b/Neos.Flow/Classes/I18n/FormatResolver.php @@ -1,4 +1,5 @@ localizationService->getConfiguration()->getDefaultLocale(); diff --git a/Neos.Flow/Classes/I18n/LocaleTypeConverter.php b/Neos.Flow/Classes/I18n/LocaleTypeConverter.php index f176815432..075171b925 100644 --- a/Neos.Flow/Classes/I18n/LocaleTypeConverter.php +++ b/Neos.Flow/Classes/I18n/LocaleTypeConverter.php @@ -1,4 +1,5 @@ configuration->getCurrentLocale(); @@ -177,7 +178,7 @@ public function getLocalizedFilename($pathAndFilename, Locale $locale = null, $s * @see Configuration::setFallbackRule() * @api */ - public function getXliffFilenameAndPath($path, $sourceName, Locale $locale = null) + public function getXliffFilenameAndPath($path, $sourceName, ?Locale $locale = null) { if ($locale === null) { $locale = $this->configuration->getCurrentLocale(); diff --git a/Neos.Flow/Classes/I18n/Translator.php b/Neos.Flow/Classes/I18n/Translator.php index 5bab4c06c2..dfef974209 100644 --- a/Neos.Flow/Classes/I18n/Translator.php +++ b/Neos.Flow/Classes/I18n/Translator.php @@ -1,4 +1,5 @@ localizationService->getConfiguration()->getCurrentLocale(); @@ -145,15 +146,13 @@ public function translateByOriginalLabel($originalLabel, array $arguments = [], $translatedMessage, $arguments, $localeInChain - ) - ; + ); } } return $arguments === [] ? $originalLabel - : $this->formatResolver->resolvePlaceholders($originalLabel, $arguments, $locale) - ; + : $this->formatResolver->resolvePlaceholders($originalLabel, $arguments, $locale); } /** @@ -181,7 +180,7 @@ public function translateByOriginalLabel($originalLabel, array $arguments = [], * @api * @see Translator::translateByOriginalLabel() */ - public function translateById($labelId, array $arguments = [], $quantity = null, Locale $locale = null, $sourceName = 'Main', $packageKey = 'Neos.Flow') + public function translateById($labelId, array $arguments = [], $quantity = null, ?Locale $locale = null, $sourceName = 'Main', $packageKey = 'Neos.Flow') { if ($locale === null) { $locale = $this->localizationService->getConfiguration()->getCurrentLocale(); @@ -203,8 +202,7 @@ public function translateById($labelId, array $arguments = [], $quantity = null, $translatedMessage, $arguments, $localeInChain - ) - ; + ); } } diff --git a/Neos.Flow/Classes/Mvc/RequestMatcher.php b/Neos.Flow/Classes/Mvc/RequestMatcher.php index 07420f05fe..e05fce1107 100644 --- a/Neos.Flow/Classes/Mvc/RequestMatcher.php +++ b/Neos.Flow/Classes/Mvc/RequestMatcher.php @@ -1,4 +1,5 @@ request = $actionRequest; $this->parentMatcher = $parentMatcher; diff --git a/Neos.Flow/Classes/Mvc/Routing/Dto/MatchResult.php b/Neos.Flow/Classes/Mvc/Routing/Dto/MatchResult.php index c775fd4567..90c5dfa546 100644 --- a/Neos.Flow/Classes/Mvc/Routing/Dto/MatchResult.php +++ b/Neos.Flow/Classes/Mvc/Routing/Dto/MatchResult.php @@ -1,4 +1,5 @@ matchedValue = $matchedValue; $this->tags = $tags; diff --git a/Neos.Flow/Classes/Mvc/Routing/Dto/ResolveResult.php b/Neos.Flow/Classes/Mvc/Routing/Dto/ResolveResult.php index d13bef5fde..61fe9e2725 100644 --- a/Neos.Flow/Classes/Mvc/Routing/Dto/ResolveResult.php +++ b/Neos.Flow/Classes/Mvc/Routing/Dto/ResolveResult.php @@ -1,4 +1,5 @@ resolvedValue = $resolvedValue; $this->uriConstraints = $uriConstraints; diff --git a/Neos.Flow/Classes/Mvc/Routing/Router.php b/Neos.Flow/Classes/Mvc/Routing/Router.php index 44e431b39c..365e1a934a 100644 --- a/Neos.Flow/Classes/Mvc/Routing/Router.php +++ b/Neos.Flow/Classes/Mvc/Routing/Router.php @@ -1,4 +1,5 @@ routesConfiguration = $routesConfiguration; $this->routesCreated = false; diff --git a/Neos.Flow/Classes/Mvc/Routing/RouterCachingService.php b/Neos.Flow/Classes/Mvc/Routing/RouterCachingService.php index d6658810db..ee85913f86 100644 --- a/Neos.Flow/Classes/Mvc/Routing/RouterCachingService.php +++ b/Neos.Flow/Classes/Mvc/Routing/RouterCachingService.php @@ -1,4 +1,5 @@ containsObject($matchResults)) { return; @@ -124,7 +125,7 @@ public function storeMatchResults(RouteContext $routeContext, array $matchResult if ($matchedTags !== null) { $tags = array_unique(array_merge($matchedTags->getTags(), $tags)); } - $lifetime = $matchedLifetime ? $matchedLifetime ->getValue() : null; + $lifetime = $matchedLifetime ? $matchedLifetime->getValue() : null; $this->routeCache->set($routeContext->getCacheEntryIdentifier(), $matchResults, $tags, $lifetime); } @@ -152,7 +153,7 @@ public function getCachedResolvedUriConstraints(ResolveContext $resolveContext) * @param RouteLifetime|null $resolvedLifetime * @return void */ - public function storeResolvedUriConstraints(ResolveContext $resolveContext, UriConstraints $uriConstraints, RouteTags $resolvedTags = null, RouteLifetime $resolvedLifetime = null) + public function storeResolvedUriConstraints(ResolveContext $resolveContext, UriConstraints $uriConstraints, RouteTags $resolvedTags = null, ?RouteLifetime $resolvedLifetime = null) { $routeValues = $this->convertObjectsToHashes($resolveContext->getRouteValues()); if ($routeValues === null) { diff --git a/Neos.Flow/Classes/Mvc/Routing/UriBuilder.php b/Neos.Flow/Classes/Mvc/Routing/UriBuilder.php index 5eb57b2a94..4ca3827b8a 100644 --- a/Neos.Flow/Classes/Mvc/Routing/UriBuilder.php +++ b/Neos.Flow/Classes/Mvc/Routing/UriBuilder.php @@ -1,4 +1,5 @@ createAbsoluteUri = (boolean)$createAbsoluteUri; + $this->createAbsoluteUri = (bool)$createAbsoluteUri; return $this; } @@ -209,7 +210,7 @@ public function getCreateAbsoluteUri() */ public function setAddQueryString($addQueryString) { - $this->addQueryString = (boolean)$addQueryString; + $this->addQueryString = (bool)$addQueryString; return $this; } @@ -289,7 +290,7 @@ public function reset() * @throws Exception\MissingActionNameException if $actionName parameter is empty * @throws \Neos\Flow\Http\Exception */ - public function uriFor(string $actionName, array $controllerArguments = [], string $controllerName = null, string $packageKey = null, string $subPackageKey = null) + public function uriFor(string $actionName, array $controllerArguments = [], string $controllerName = null, string $packageKey = null, ?string $subPackageKey = null) { if (empty($actionName)) { throw new Exception\MissingActionNameException('The URI Builder could not build a URI linking to an action controller because no action name was specified. Please check the stack trace to see which code or template was requesting the link and check the arguments passed to the URI Builder.', 1354629891); diff --git a/Neos.Flow/Classes/Package/PackageFactory.php b/Neos.Flow/Classes/Package/PackageFactory.php index 8a3725c352..a3b6a21184 100644 --- a/Neos.Flow/Classes/Package/PackageFactory.php +++ b/Neos.Flow/Classes/Package/PackageFactory.php @@ -1,4 +1,5 @@ bootstrap->getContext()->isDevelopment()) { /** @var PackageInterface $package */ foreach ($this->packages as $packageKey => $package) { - if (isset($this->packageStatesConfiguration['packages'][$package->getComposerName()]['frozen']) && + if ( + isset($this->packageStatesConfiguration['packages'][$package->getComposerName()]['frozen']) && $this->packageStatesConfiguration['packages'][$package->getComposerName()]['frozen'] === true ) { $frozenPackages[$packageKey] = $package; @@ -331,7 +333,8 @@ public function createPackage($packageKey, array $manifest = [], $packagesPath = $composerManifestRepositories = ComposerUtility::getComposerManifest(FLOW_PATH_ROOT, 'repositories'); if (is_array($composerManifestRepositories)) { foreach ($composerManifestRepositories as $repository) { - if (is_array($repository) && + if ( + is_array($repository) && isset($repository['type']) && $repository['type'] === 'path' && isset($repository['url']) && substr($repository['url'], 0, 2) === './' && substr($repository['url'], -2) === '/*' ) { @@ -362,7 +365,8 @@ public function createPackage($packageKey, array $manifest = [], $packagesPath = FlowPackageInterface::DIRECTORY_RESOURCES, FlowPackageInterface::DIRECTORY_TESTS_UNIT, FlowPackageInterface::DIRECTORY_TESTS_FUNCTIONAL, - ] as $path) { + ] as $path + ) { Files::createDirectoryRecursively(Files::concatenatePaths([$packagePath, $path])); } @@ -881,7 +885,7 @@ protected function getPackageKeyFromManifest(array $manifest, $packagePath): str * @param string $autoloadNamespace * @return string */ - protected function derivePackageKey(string $composerName, string $packageType = null, string $packagePath = '', string $autoloadNamespace = null): string + protected function derivePackageKey(string $composerName, string $packageType = null, string $packagePath = '', ?string $autoloadNamespace = null): string { $packageKey = ''; diff --git a/Neos.Flow/Classes/Persistence/Doctrine/ArrayTypeConverter.php b/Neos.Flow/Classes/Persistence/Doctrine/ArrayTypeConverter.php index b4b6d09cf4..2904829f2b 100644 --- a/Neos.Flow/Classes/Persistence/Doctrine/ArrayTypeConverter.php +++ b/Neos.Flow/Classes/Persistence/Doctrine/ArrayTypeConverter.php @@ -1,4 +1,5 @@ getConfigurationValue(ArrayTypeConverter::class, self::CONFIGURATION_CONVERT_ELEMENTS); diff --git a/Neos.Flow/Classes/Persistence/Doctrine/Logging/SqlLogger.php b/Neos.Flow/Classes/Persistence/Doctrine/Logging/SqlLogger.php index 0878b08a30..b12c62f6cb 100644 --- a/Neos.Flow/Classes/Persistence/Doctrine/Logging/SqlLogger.php +++ b/Neos.Flow/Classes/Persistence/Doctrine/Logging/SqlLogger.php @@ -1,4 +1,5 @@ logger instanceof DependencyProxy) { $this->logger->_activateDependency(); diff --git a/Neos.Flow/Classes/Persistence/Doctrine/PersistenceManager.php b/Neos.Flow/Classes/Persistence/Doctrine/PersistenceManager.php index 7d4afb2c89..2009d34e31 100644 --- a/Neos.Flow/Classes/Persistence/Doctrine/PersistenceManager.php +++ b/Neos.Flow/Classes/Persistence/Doctrine/PersistenceManager.php @@ -1,4 +1,5 @@ createQuery(); - $caseSensitive = isset($arguments[1]) ? (boolean)$arguments[1] : true; - $cacheResult = isset($arguments[2]) ? (boolean)$arguments[2] : false; + $caseSensitive = isset($arguments[1]) ? (bool)$arguments[1] : true; + $cacheResult = isset($arguments[2]) ? (bool)$arguments[2] : false; if (isset($method[10]) && strpos($method, 'findOneBy') === 0) { $propertyName = lcfirst(substr($method, 9)); diff --git a/Neos.Flow/Classes/Persistence/Doctrine/Service.php b/Neos.Flow/Classes/Persistence/Doctrine/Service.php index c4a7649106..938ab1a25f 100644 --- a/Neos.Flow/Classes/Persistence/Doctrine/Service.php +++ b/Neos.Flow/Classes/Persistence/Doctrine/Service.php @@ -1,4 +1,5 @@ entityManager->createQuery($dql); if ($firstResult !== null) { @@ -306,7 +307,7 @@ private function getSortedVersions(AvailableMigrationsList $availableMigrations, * @return string * @throws DBALException */ - public function executeMigrations(string $version = 'latest', string $outputPathAndFilename = null, $dryRun = false, $quiet = false): string + public function executeMigrations(string $version = 'latest', ?string $outputPathAndFilename = null, $dryRun = false, $quiet = false): string { $this->initializeMetadataStorage(); @@ -413,7 +414,7 @@ private function exitMessageForAlias(string $versionAlias): string * @return string * @throws DBALException */ - public function executeMigration(string $version, string $direction = 'up', string $outputPathAndFilename = null, bool $dryRun = false): string + public function executeMigration(string $version, string $direction = 'up', ?string $outputPathAndFilename = null, bool $dryRun = false): string { $this->initializeMetadataStorage(); @@ -604,7 +605,7 @@ public function getMigrationStatus(): array * @return array Path to the new file * @throws DBALException */ - public function generateMigration(bool $diffAgainstCurrent = true, string $filterExpression = null): array + public function generateMigration(bool $diffAgainstCurrent = true, ?string $filterExpression = null): array { $fqcn = $this->getDependencyFactory()->getClassNameGenerator()->generateClassName(self::DOCTRINE_MIGRATIONSNAMESPACE); diff --git a/Neos.Flow/Classes/Persistence/PersistenceManagerInterface.php b/Neos.Flow/Classes/Persistence/PersistenceManagerInterface.php index d62ffc1959..393eb66224 100644 --- a/Neos.Flow/Classes/Persistence/PersistenceManagerInterface.php +++ b/Neos.Flow/Classes/Persistence/PersistenceManagerInterface.php @@ -1,4 +1,5 @@ buildPropertyMappingConfiguration(); diff --git a/Neos.Flow/Classes/Property/TypeConverter/AbstractTypeConverter.php b/Neos.Flow/Classes/Property/TypeConverter/AbstractTypeConverter.php index e008c64d79..cbd8bfbd7f 100644 --- a/Neos.Flow/Classes/Property/TypeConverter/AbstractTypeConverter.php +++ b/Neos.Flow/Classes/Property/TypeConverter/AbstractTypeConverter.php @@ -1,4 +1,5 @@ getDefaultDateFormat($configuration); $isFormatSpecified = false; @@ -197,7 +198,7 @@ protected function isDatePartKeysProvided(array $source) * @return string * @throws InvalidPropertyMappingConfigurationException */ - protected function getDefaultDateFormat(PropertyMappingConfigurationInterface $configuration = null) + protected function getDefaultDateFormat(?PropertyMappingConfigurationInterface $configuration = null) { if ($configuration === null) { return self::DEFAULT_DATE_FORMAT; @@ -220,9 +221,9 @@ protected function getDefaultDateFormat(PropertyMappingConfigurationInterface $c */ protected function overrideTime(\DateTimeInterface $date, array $source) { - $hour = isset($source['hour']) ? (integer)$source['hour'] : 0; - $minute = isset($source['minute']) ? (integer)$source['minute'] : 0; - $second = isset($source['second']) ? (integer)$source['second'] : 0; + $hour = isset($source['hour']) ? (int)$source['hour'] : 0; + $minute = isset($source['minute']) ? (int)$source['minute'] : 0; + $second = isset($source['second']) ? (int)$source['second'] : 0; if ($date instanceof \DateTime || $date instanceof \DateTimeImmutable) { $date = $date->setTime($hour, $minute, $second); } diff --git a/Neos.Flow/Classes/Property/TypeConverter/DenormalizingObjectConverter.php b/Neos.Flow/Classes/Property/TypeConverter/DenormalizingObjectConverter.php index 5b5c5131f2..3cf22adc7c 100644 --- a/Neos.Flow/Classes/Property/TypeConverter/DenormalizingObjectConverter.php +++ b/Neos.Flow/Classes/Property/TypeConverter/DenormalizingObjectConverter.php @@ -1,4 +1,5 @@ format('U'); @@ -65,6 +66,6 @@ public function convertFrom($source, $targetType, array $convertedChildPropertie if (!is_numeric($source)) { return new Error('"%s" is not numeric.', 1332933658, [$source]); } - return (integer)$source; + return (int)$source; } } diff --git a/Neos.Flow/Classes/Property/TypeConverter/MediaTypeConverter.php b/Neos.Flow/Classes/Property/TypeConverter/MediaTypeConverter.php index 39746cbbc2..9bd1e83fcc 100644 --- a/Neos.Flow/Classes/Property/TypeConverter/MediaTypeConverter.php +++ b/Neos.Flow/Classes/Property/TypeConverter/MediaTypeConverter.php @@ -1,4 +1,5 @@ buildObject($convertedChildProperties, $targetType); foreach ($convertedChildProperties as $propertyName => $propertyValue) { @@ -210,7 +211,7 @@ public function convertFrom($source, $targetType, array $convertedChildPropertie * @throws InvalidPropertyMappingConfigurationException * @throws \InvalidArgumentException */ - public function getTargetTypeForSource($source, $originalTargetType, PropertyMappingConfigurationInterface $configuration = null) + public function getTargetTypeForSource($source, $originalTargetType, ?PropertyMappingConfigurationInterface $configuration = null) { $targetType = $originalTargetType; diff --git a/Neos.Flow/Classes/Property/TypeConverter/PersistentObjectConverter.php b/Neos.Flow/Classes/Property/TypeConverter/PersistentObjectConverter.php index 53ec73f776..5621d49d46 100644 --- a/Neos.Flow/Classes/Property/TypeConverter/PersistentObjectConverter.php +++ b/Neos.Flow/Classes/Property/TypeConverter/PersistentObjectConverter.php @@ -1,4 +1,5 @@ reflectionService->isClassAnnotatedWith($targetType, ValueObject::class) === true) { diff --git a/Neos.Flow/Classes/Property/TypeConverter/PersistentObjectSerializer.php b/Neos.Flow/Classes/Property/TypeConverter/PersistentObjectSerializer.php index f554bf54ee..3e0e8c3d3b 100644 --- a/Neos.Flow/Classes/Property/TypeConverter/PersistentObjectSerializer.php +++ b/Neos.Flow/Classes/Property/TypeConverter/PersistentObjectSerializer.php @@ -1,4 +1,5 @@ persistenceManager->getIdentifierByObject($source); } diff --git a/Neos.Flow/Classes/Property/TypeConverter/ScalarTypeToObjectConverter.php b/Neos.Flow/Classes/Property/TypeConverter/ScalarTypeToObjectConverter.php index 4a3dbc7bf2..426039bede 100644 --- a/Neos.Flow/Classes/Property/TypeConverter/ScalarTypeToObjectConverter.php +++ b/Neos.Flow/Classes/Property/TypeConverter/ScalarTypeToObjectConverter.php @@ -1,4 +1,5 @@ sessionManager->getSession($source); } diff --git a/Neos.Flow/Classes/Property/TypeConverter/StringConverter.php b/Neos.Flow/Classes/Property/TypeConverter/StringConverter.php index bee883704d..f613152cb1 100644 --- a/Neos.Flow/Classes/Property/TypeConverter/StringConverter.php +++ b/Neos.Flow/Classes/Property/TypeConverter/StringConverter.php @@ -1,4 +1,5 @@ getDateFormat($configuration); @@ -131,7 +132,7 @@ public function convertFrom($source, $targetType, array $convertedChildPropertie * @return string * @throws InvalidPropertyMappingConfigurationException */ - protected function getDateFormat(PropertyMappingConfigurationInterface $configuration = null) + protected function getDateFormat(?PropertyMappingConfigurationInterface $configuration = null) { if ($configuration === null) { return self::DEFAULT_DATE_FORMAT; @@ -156,7 +157,7 @@ protected function getDateFormat(PropertyMappingConfigurationInterface $configur * @return string * @throws InvalidPropertyMappingConfigurationException */ - protected function getCsvDelimiter(PropertyMappingConfigurationInterface $configuration = null) + protected function getCsvDelimiter(?PropertyMappingConfigurationInterface $configuration = null) { if ($configuration === null) { return self::DEFAULT_CSV_DELIMITER; @@ -181,7 +182,7 @@ protected function getCsvDelimiter(PropertyMappingConfigurationInterface $config * @return string * @throws InvalidPropertyMappingConfigurationException */ - protected function getArrayFormat(PropertyMappingConfigurationInterface $configuration = null) + protected function getArrayFormat(?PropertyMappingConfigurationInterface $configuration = null) { if ($configuration === null) { return self::DEFAULT_ARRAY_FORMAT; diff --git a/Neos.Flow/Classes/Property/TypeConverter/TypedArrayConverter.php b/Neos.Flow/Classes/Property/TypeConverter/TypedArrayConverter.php index a77a2c7e63..18d7c1e1b1 100644 --- a/Neos.Flow/Classes/Property/TypeConverter/TypedArrayConverter.php +++ b/Neos.Flow/Classes/Property/TypeConverter/TypedArrayConverter.php @@ -1,4 +1,5 @@ */ - public function getObjects(callable $callback = null) + public function getObjects(?callable $callback = null) { if ($this->storage instanceof PackageStorage && $this->pathPatterns !== []) { foreach ($this->pathPatterns as $pathPattern) { diff --git a/Neos.Flow/Classes/ResourceManagement/Publishing/MessageCollector.php b/Neos.Flow/Classes/ResourceManagement/Publishing/MessageCollector.php index ae8d5a44aa..3c35627323 100644 --- a/Neos.Flow/Classes/ResourceManagement/Publishing/MessageCollector.php +++ b/Neos.Flow/Classes/ResourceManagement/Publishing/MessageCollector.php @@ -1,4 +1,5 @@ messages as $message) { /** @var Message $message */ diff --git a/Neos.Flow/Classes/ResourceManagement/ResourceRepository.php b/Neos.Flow/Classes/ResourceManagement/ResourceRepository.php index 85ea1d0eaa..8be810208a 100644 --- a/Neos.Flow/Classes/ResourceManagement/ResourceRepository.php +++ b/Neos.Flow/Classes/ResourceManagement/ResourceRepository.php @@ -1,4 +1,5 @@ getError() === UPLOAD_ERR_NO_FILE && $source->getOriginallySubmittedResource() !== null) { $identifier = is_array($source->getOriginallySubmittedResource()) ? $source->getOriginallySubmittedResource()['__identity'] : $source->getOriginallySubmittedResource(); @@ -329,7 +330,7 @@ protected function handleUploadedFile(UploadedFileInterface $source, PropertyMap * @return string * @throws InvalidPropertyMappingConfigurationException */ - protected function getCollectionName($source, PropertyMappingConfigurationInterface $configuration = null) + protected function getCollectionName($source, ?PropertyMappingConfigurationInterface $configuration = null) { if ($configuration === null) { return ResourceManager::DEFAULT_PERSISTENT_COLLECTION_NAME; diff --git a/Neos.Flow/Classes/ResourceManagement/Storage/FileSystemStorage.php b/Neos.Flow/Classes/ResourceManagement/Storage/FileSystemStorage.php index 45672f1631..bfb6ae6855 100644 --- a/Neos.Flow/Classes/ResourceManagement/Storage/FileSystemStorage.php +++ b/Neos.Flow/Classes/ResourceManagement/Storage/FileSystemStorage.php @@ -1,4 +1,5 @@ */ - public function getObjects(callable $callback = null) + public function getObjects(?callable $callback = null) { foreach ($this->resourceManager->getCollectionsByStorage($this) as $collection) { yield from $this->getObjectsByCollection($collection, $callback); @@ -147,7 +148,7 @@ public function getObjects(callable $callback = null) * @param callable|null $callback Function called after each iteration * @return \Generator */ - public function getObjectsByCollection(CollectionInterface $collection, callable $callback = null) + public function getObjectsByCollection(CollectionInterface $collection, ?callable $callback = null) { $iterator = $this->resourceRepository->findByCollectionNameIterator($collection->getName()); $iteration = 0; diff --git a/Neos.Flow/Classes/ResourceManagement/Storage/PackageStorage.php b/Neos.Flow/Classes/ResourceManagement/Storage/PackageStorage.php index 724eb4d2bd..9dd87a66f5 100644 --- a/Neos.Flow/Classes/ResourceManagement/Storage/PackageStorage.php +++ b/Neos.Flow/Classes/ResourceManagement/Storage/PackageStorage.php @@ -1,4 +1,5 @@ */ - public function getObjects(callable $callback = null) + public function getObjects(?callable $callback = null) { return $this->getObjectsByPathPattern('*'); } @@ -57,7 +58,7 @@ public function getObjects(callable $callback = null) * @param callable $callback Function called after each object * @return \Generator */ - public function getObjectsByPathPattern($pattern, callable $callback = null) + public function getObjectsByPathPattern($pattern, ?callable $callback = null) { $directories = []; diff --git a/Neos.Flow/Classes/ResourceManagement/Target/FileSystemSymlinkTarget.php b/Neos.Flow/Classes/ResourceManagement/Target/FileSystemSymlinkTarget.php index d611914a3d..8b0e248706 100644 --- a/Neos.Flow/Classes/ResourceManagement/Target/FileSystemSymlinkTarget.php +++ b/Neos.Flow/Classes/ResourceManagement/Target/FileSystemSymlinkTarget.php @@ -1,4 +1,5 @@ getStorage(); if ($storage instanceof PackageStorage) { @@ -141,7 +142,7 @@ protected function publishDirectory($sourcePath, $relativeTargetPathAndFilename) protected function setOption($key, $value) { if ($key === 'relativeSymlinks') { - $this->relativeSymlinks = (boolean)$value; + $this->relativeSymlinks = (bool)$value; return true; } diff --git a/Neos.Flow/Classes/ResourceManagement/Target/FileSystemTarget.php b/Neos.Flow/Classes/ResourceManagement/Target/FileSystemTarget.php index af71858c29..9f482b8fa4 100644 --- a/Neos.Flow/Classes/ResourceManagement/Target/FileSystemTarget.php +++ b/Neos.Flow/Classes/ResourceManagement/Target/FileSystemTarget.php @@ -193,7 +193,7 @@ protected function checkAndRemovePackageSymlinks(StorageInterface $storage) * @param callable $callback Function called after each resource publishing * @return void */ - public function publishCollection(CollectionInterface $collection, callable $callback = null) + public function publishCollection(CollectionInterface $collection, ?callable $callback = null) { $storage = $collection->getStorage(); $this->checkAndRemovePackageSymlinks($storage); @@ -441,7 +441,7 @@ protected function setOption($key, $value) $this->excludedExtensions = $value; break; case 'subdivideHashPathSegment': - $this->subdivideHashPathSegment = (boolean)$value; + $this->subdivideHashPathSegment = (bool)$value; break; default: return false; diff --git a/Neos.Flow/Classes/Security/Account.php b/Neos.Flow/Classes/Security/Account.php index dca697973b..efdeaf3b36 100644 --- a/Neos.Flow/Classes/Security/Account.php +++ b/Neos.Flow/Classes/Security/Account.php @@ -1,4 +1,5 @@ expirationDate = $expirationDate; } diff --git a/Neos.Flow/Classes/Security/Authentication/Controller/AbstractAuthenticationController.php b/Neos.Flow/Classes/Security/Authentication/Controller/AbstractAuthenticationController.php index 6861e19ce0..8d9db89950 100644 --- a/Neos.Flow/Classes/Security/Authentication/Controller/AbstractAuthenticationController.php +++ b/Neos.Flow/Classes/Security/Authentication/Controller/AbstractAuthenticationController.php @@ -1,4 +1,5 @@ controllerContext->getFlashMessageContainer()->addMessage(new Error('Authentication failed!', ($exception === null ? 1347016771 : $exception->getCode()))); } @@ -137,7 +138,7 @@ protected function onAuthenticationFailure(AuthenticationRequiredException $exce * @param ActionRequest $originalRequest The request that was intercepted by the security framework, NULL if there was none * @return string */ - abstract protected function onAuthenticationSuccess(ActionRequest $originalRequest = null); + abstract protected function onAuthenticationSuccess(?ActionRequest $originalRequest = null); /** diff --git a/Neos.Flow/Classes/Security/Authentication/Token/AbstractToken.php b/Neos.Flow/Classes/Security/Authentication/Token/AbstractToken.php index b8bc6e5ed3..b14323b6e2 100644 --- a/Neos.Flow/Classes/Security/Authentication/Token/AbstractToken.php +++ b/Neos.Flow/Classes/Security/Authentication/Token/AbstractToken.php @@ -1,4 +1,5 @@ options = $options ?? []; } @@ -180,7 +181,7 @@ public function getCredentials() */ public function getAccount() { - return $this->isAuthenticated() ? $this->account: null; + return $this->isAuthenticated() ? $this->account : null; } /** @@ -189,7 +190,7 @@ public function getAccount() * @param Account $account An account object * @return void */ - public function setAccount(Account $account = null) + public function setAccount(?Account $account = null) { $this->account = $account; } diff --git a/Neos.Flow/Classes/Security/Authentication/TokenInterface.php b/Neos.Flow/Classes/Security/Authentication/TokenInterface.php index e3a6246454..ba4df779c2 100644 --- a/Neos.Flow/Classes/Security/Authentication/TokenInterface.php +++ b/Neos.Flow/Classes/Security/Authentication/TokenInterface.php @@ -1,4 +1,5 @@ withPrivilege($privilege); } diff --git a/Neos.Flow/Classes/Security/Authorization/PrivilegePermissionResult.php b/Neos.Flow/Classes/Security/Authorization/PrivilegePermissionResult.php index 4ed3d1f424..12523a5a79 100644 --- a/Neos.Flow/Classes/Security/Authorization/PrivilegePermissionResult.php +++ b/Neos.Flow/Classes/Security/Authorization/PrivilegePermissionResult.php @@ -1,4 +1,5 @@ initialized === false) { $this->initialize(); diff --git a/Neos.Flow/Classes/Security/DummyContext.php b/Neos.Flow/Classes/Security/DummyContext.php index ce31b34a04..59eb443357 100644 --- a/Neos.Flow/Classes/Security/DummyContext.php +++ b/Neos.Flow/Classes/Security/DummyContext.php @@ -1,4 +1,5 @@ interceptedRequest = $interceptedRequest; } diff --git a/Neos.Flow/Classes/Security/Policy/RoleConverter.php b/Neos.Flow/Classes/Security/Policy/RoleConverter.php index a807e0341e..aa2e5ced4d 100644 --- a/Neos.Flow/Classes/Security/Policy/RoleConverter.php +++ b/Neos.Flow/Classes/Security/Policy/RoleConverter.php @@ -1,4 +1,5 @@ policyService->getRole($source); diff --git a/Neos.Flow/Classes/Security/SessionDataContainer.php b/Neos.Flow/Classes/Security/SessionDataContainer.php index f0f4a3c183..22d6f46a55 100644 --- a/Neos.Flow/Classes/Security/SessionDataContainer.php +++ b/Neos.Flow/Classes/Security/SessionDataContainer.php @@ -1,4 +1,5 @@ interceptedRequest = $interceptedRequest; } diff --git a/Neos.Flow/Classes/Validation/ValidatorResolver.php b/Neos.Flow/Classes/Validation/ValidatorResolver.php index 3cd11c7b55..f7d4cca0db 100644 --- a/Neos.Flow/Classes/Validation/ValidatorResolver.php +++ b/Neos.Flow/Classes/Validation/ValidatorResolver.php @@ -1,4 +1,5 @@ reflectionService->isPropertyAnnotatedWith($targetClassName, $classPropertyName, Flow\IgnoreValidation::class)) { continue; } - if ($classSchema !== null + if ( + $classSchema !== null && $classSchema->hasProperty($classPropertyName) && $classSchema->isPropertyTransient($classPropertyName) - && $validationGroups === ['Persistence', 'Default']) { + && $validationGroups === ['Persistence', 'Default'] + ) { continue; } diff --git a/Neos.Flow/Documentation/TheDefinitiveGuide/PartII/Controller.rst b/Neos.Flow/Documentation/TheDefinitiveGuide/PartII/Controller.rst index 37dd611570..aa3ce8da8a 100644 --- a/Neos.Flow/Documentation/TheDefinitiveGuide/PartII/Controller.rst +++ b/Neos.Flow/Documentation/TheDefinitiveGuide/PartII/Controller.rst @@ -52,7 +52,7 @@ The kickstarter created a very basic command controller containing only one comm * @param string $requiredArgument This argument is required * @param string $optionalArgument This argument is optional */ - public function exampleCommand(string $requiredArgument, string $optionalArgument = null): void + public function exampleCommand(string $requiredArgument, ?string $optionalArgument = null): void { $this->outputLine('You called the example command and passed "%s" as the first argument.', array($requiredArgument)); } diff --git a/Neos.Flow/Documentation/TheDefinitiveGuide/PartIII/Security.rst b/Neos.Flow/Documentation/TheDefinitiveGuide/PartIII/Security.rst index 82cfd01690..7819a27a68 100644 --- a/Neos.Flow/Documentation/TheDefinitiveGuide/PartIII/Security.rst +++ b/Neos.Flow/Documentation/TheDefinitiveGuide/PartIII/Security.rst @@ -74,7 +74,7 @@ You may also want to override ``onAuthenticationFailure()`` to react on login pr * @param ActionRequest $originalRequest The request that was intercepted by the security framework, null if there was none * @return string */ - protected function onAuthenticationSuccess(ActionRequest $originalRequest = null) { + protected function onAuthenticationSuccess(?ActionRequest $originalRequest = null) { if ($originalRequest !== null) { $this->redirectToRequest($originalRequest); } diff --git a/Neos.Flow/Scripts/Migrations/Manager.php b/Neos.Flow/Scripts/Migrations/Manager.php index fde91d0e59..0b143f89aa 100644 --- a/Neos.Flow/Scripts/Migrations/Manager.php +++ b/Neos.Flow/Scripts/Migrations/Manager.php @@ -1,4 +1,5 @@ eventCallbacks[$eventIdentifier])) { return; diff --git a/Neos.Flow/Tests/Functional/Command/PyStringNodeConverter.php b/Neos.Flow/Tests/Functional/Command/PyStringNodeConverter.php index 2d0e1702a5..d8d8d73ed2 100644 --- a/Neos.Flow/Tests/Functional/Command/PyStringNodeConverter.php +++ b/Neos.Flow/Tests/Functional/Command/PyStringNodeConverter.php @@ -1,4 +1,5 @@ serverRequestFactory->createServerRequest('GET', new Uri($requestUri)); try { @@ -337,7 +338,7 @@ public function routesWithoutRequestedHttpMethodConfiguredResultInA404($requestM '@subpackage' => 'Tests\Functional\Mvc\Fixtures', '@controller' => 'ActionControllerTestA', '@action' => 'second', - '@format' =>'html' + '@format' => 'html' ], false, ['POST', 'DELETE'] diff --git a/Neos.Flow/Tests/Functional/Persistence/Fixtures/ExtendedTypesEntity.php b/Neos.Flow/Tests/Functional/Persistence/Fixtures/ExtendedTypesEntity.php index cf453a73fe..f49497e5e7 100644 --- a/Neos.Flow/Tests/Functional/Persistence/Fixtures/ExtendedTypesEntity.php +++ b/Neos.Flow/Tests/Functional/Persistence/Fixtures/ExtendedTypesEntity.php @@ -1,4 +1,5 @@ date = $date; return $this; @@ -124,7 +125,7 @@ public function getDate() * @param \DateTime $dateTimeTz * @return $this */ - public function setDateTimeTz(\DateTime $dateTimeTz = null) + public function setDateTimeTz(?\DateTime $dateTimeTz = null) { $this->dateTimeTz = $dateTimeTz; return $this; @@ -142,7 +143,7 @@ public function getDateTimeTz() * @param \DateTime $dateTime * @return $this */ - public function setDateTime(\DateTime $dateTime = null) + public function setDateTime(?\DateTime $dateTime = null) { $this->dateTime = $dateTime; return $this; @@ -160,7 +161,7 @@ public function getDateTime() * @param \DateTimeImmutable $dateTime * @return $this */ - public function setDateTimeImmutable(\DateTimeImmutable $dateTime = null) + public function setDateTimeImmutable(?\DateTimeImmutable $dateTime = null) { $this->dateTimeImmutable = $dateTime; return $this; @@ -178,7 +179,7 @@ public function getDateTimeImmutable() * @param \DateTimeInterface $dateTime * @return $this */ - public function setDateTimeInterface(\DateTimeInterface $dateTime = null) + public function setDateTimeInterface(?\DateTimeInterface $dateTime = null) { $this->dateTimeInterface = $dateTime; return $this; @@ -196,7 +197,7 @@ public function getDateTimeInterface() * @param CommonObject $commonObject * @return $this */ - public function setCommonObject(CommonObject $commonObject = null) + public function setCommonObject(?CommonObject $commonObject = null) { $this->commonObject = $commonObject; return $this; @@ -214,7 +215,7 @@ public function getCommonObject() * @param array $simpleArray * @return $this */ - public function setSimpleArray(array $simpleArray = null) + public function setSimpleArray(?array $simpleArray = null) { $this->simpleArray = $simpleArray; return $this; @@ -232,7 +233,7 @@ public function getSimpleArray() * @param array $jsonArray * @return $this */ - public function setJsonArray(array $jsonArray = null) + public function setJsonArray(?array $jsonArray = null) { $this->jsonArray = $jsonArray; return $this; diff --git a/Neos.Flow/Tests/Functional/Persistence/Fixtures/Image.php b/Neos.Flow/Tests/Functional/Persistence/Fixtures/Image.php index f110b69bbf..c8fc99cc0c 100644 --- a/Neos.Flow/Tests/Functional/Persistence/Fixtures/Image.php +++ b/Neos.Flow/Tests/Functional/Persistence/Fixtures/Image.php @@ -1,4 +1,5 @@ relatedObject = $relatedObject; } diff --git a/Neos.Flow/Tests/Functional/Property/Fixtures/BoolToIntConverter.php b/Neos.Flow/Tests/Functional/Property/Fixtures/BoolToIntConverter.php index 853800dc94..c28709c174 100644 --- a/Neos.Flow/Tests/Functional/Property/Fixtures/BoolToIntConverter.php +++ b/Neos.Flow/Tests/Functional/Property/Fixtures/BoolToIntConverter.php @@ -1,4 +1,5 @@ expectException(Exception::class); $source = [ diff --git a/Neos.Flow/Tests/Functional/Security/Fixtures/Controller/AuthenticationController.php b/Neos.Flow/Tests/Functional/Security/Fixtures/Controller/AuthenticationController.php index 71479e97d8..e256040ce0 100644 --- a/Neos.Flow/Tests/Functional/Security/Fixtures/Controller/AuthenticationController.php +++ b/Neos.Flow/Tests/Functional/Security/Fixtures/Controller/AuthenticationController.php @@ -1,4 +1,5 @@ redirectToRequest($originalRequest); @@ -38,7 +39,7 @@ public function onAuthenticationSuccess(ActionRequest $originalRequest = null) * @param AuthenticationRequiredException $exception * @throws FlowException */ - public function onAuthenticationFailure(AuthenticationRequiredException $exception = null) + public function onAuthenticationFailure(?AuthenticationRequiredException $exception = null) { throw new FlowException('Failure Method Exception', 42); } diff --git a/Neos.Flow/Tests/Functional/Security/Fixtures/Controller/HttpBasicTestController.php b/Neos.Flow/Tests/Functional/Security/Fixtures/Controller/HttpBasicTestController.php index 52bb094c31..b09024e6af 100644 --- a/Neos.Flow/Tests/Functional/Security/Fixtures/Controller/HttpBasicTestController.php +++ b/Neos.Flow/Tests/Functional/Security/Fixtures/Controller/HttpBasicTestController.php @@ -1,4 +1,5 @@ redirectToRequest($originalRequest); @@ -42,7 +43,7 @@ public function onAuthenticationSuccess(ActionRequest $originalRequest = null) * @param AuthenticationRequiredException $exception * @throws FlowException */ - public function onAuthenticationFailure(AuthenticationRequiredException $exception = null) + public function onAuthenticationFailure(?AuthenticationRequiredException $exception = null) { throw new FlowException('Failure Method Exception', 42); } diff --git a/Neos.Flow/Tests/Functional/Security/Fixtures/Controller/UsernamePasswordTestController.php b/Neos.Flow/Tests/Functional/Security/Fixtures/Controller/UsernamePasswordTestController.php index 6540f903a4..65208ee970 100644 --- a/Neos.Flow/Tests/Functional/Security/Fixtures/Controller/UsernamePasswordTestController.php +++ b/Neos.Flow/Tests/Functional/Security/Fixtures/Controller/UsernamePasswordTestController.php @@ -1,4 +1,5 @@ redirectToRequest($originalRequest); @@ -42,7 +43,7 @@ public function onAuthenticationSuccess(ActionRequest $originalRequest = null) * @param AuthenticationRequiredException $exception * @throws FlowException */ - public function onAuthenticationFailure(AuthenticationRequiredException $exception = null) + public function onAuthenticationFailure(?AuthenticationRequiredException $exception = null) { throw new FlowException('UsernamePasswordTestController failure!', 27); } diff --git a/Neos.Flow/Tests/FunctionalTestCase.php b/Neos.Flow/Tests/FunctionalTestCase.php index 6af2923449..14287add35 100644 --- a/Neos.Flow/Tests/FunctionalTestCase.php +++ b/Neos.Flow/Tests/FunctionalTestCase.php @@ -1,4 +1,5 @@ setName($name); diff --git a/Neos.Flow/Tests/Unit/Configuration/ConfigurationManagerTest.php b/Neos.Flow/Tests/Unit/Configuration/ConfigurationManagerTest.php index 960ff6cfcd..81d5c5dcb3 100644 --- a/Neos.Flow/Tests/Unit/Configuration/ConfigurationManagerTest.php +++ b/Neos.Flow/Tests/Unit/Configuration/ConfigurationManagerTest.php @@ -1,4 +1,5 @@ 'Fallback', 'uriPattern' => '', 'defaults' => [ '@controller' => 'Standard', '@action' => 'redirect', '--posts-paginator' => [ - '@package' => '', - '@subpackage' => '', - '@controller' => '', - '@action' => '', - 'currentPage' => '1' + '@package' => '', + '@subpackage' => '', + '@controller' => '', + '@action' => '', + 'currentPage' => '1' ] ], ] @@ -1526,7 +1571,8 @@ public function buildSubrouteConfigurationsMergesSubRoutesAndProcessesPlaceholde ], ], ], - ], [ + ], + [ 'name' => 'Welcome :: Fallback', 'uriPattern' => 'welcome', 'defaults' => [ @@ -1700,12 +1746,18 @@ public function packageViewConfigurationsCallback($filenameAndPath) ]; switch ($filenameAndPath) { - case 'Flow/Configuration/Views': return $packageViewConfigurations; - case 'Flow/Configuration/Testing/Views': return $packageContextViewConfigurations; - case 'Flow/Configuration/Testing/System1/Views': return $packageSubContextViewConfigurations; - case FLOW_PATH_CONFIGURATION . 'Views': return $globalViewConfigurations; - case FLOW_PATH_CONFIGURATION . 'Testing/Views': return $globalContextViewConfigurations; - case FLOW_PATH_CONFIGURATION . 'Testing/System1/Views': return $globalSubContextViewConfigurations; + case 'Flow/Configuration/Views': + return $packageViewConfigurations; + case 'Flow/Configuration/Testing/Views': + return $packageContextViewConfigurations; + case 'Flow/Configuration/Testing/System1/Views': + return $packageSubContextViewConfigurations; + case FLOW_PATH_CONFIGURATION . 'Views': + return $globalViewConfigurations; + case FLOW_PATH_CONFIGURATION . 'Testing/Views': + return $globalContextViewConfigurations; + case FLOW_PATH_CONFIGURATION . 'Testing/System1/Views': + return $globalSubContextViewConfigurations; default: throw new \Exception('Unexpected filename: ' . $filenameAndPath); } @@ -1784,7 +1836,7 @@ public function loadingConfigurationOfCustomConfigurationTypeCallback($filenameA * @param array $methods * @return ConfigurationManager|MockObject */ - protected function getAccessibleConfigurationManager(array $methods = [], ApplicationContext $customContext = null) + protected function getAccessibleConfigurationManager(array $methods = [], ?ApplicationContext $customContext = null) { return $this->getAccessibleMock(ConfigurationManager::class, $methods, [$customContext ?? $this->mockContext]); } diff --git a/Neos.Flow/Tests/Unit/Http/Middleware/SecurityEntryPointMiddlewareTest.php b/Neos.Flow/Tests/Unit/Http/Middleware/SecurityEntryPointMiddlewareTest.php index 6513752ef6..93d672fdd9 100644 --- a/Neos.Flow/Tests/Unit/Http/Middleware/SecurityEntryPointMiddlewareTest.php +++ b/Neos.Flow/Tests/Unit/Http/Middleware/SecurityEntryPointMiddlewareTest.php @@ -1,4 +1,5 @@ mockActionRequest->expects(self::once())->method('setArguments')->with($expectedArguments); $this->buildMockHttpRequest($requestArguments, $requestBodyArguments); diff --git a/Neos.Flow/Tests/Unit/Mvc/Routing/Fixtures/MockRoutePartHandler.php b/Neos.Flow/Tests/Unit/Mvc/Routing/Fixtures/MockRoutePartHandler.php index bbce2934b2..e70479211c 100644 --- a/Neos.Flow/Tests/Unit/Mvc/Routing/Fixtures/MockRoutePartHandler.php +++ b/Neos.Flow/Tests/Unit/Mvc/Routing/Fixtures/MockRoutePartHandler.php @@ -1,4 +1,5 @@ matchValueClosure = $matchValueClosure; $this->resolveValueClosure = $resolveValueClosure; diff --git a/Neos.Flow/Tests/Unit/Reflection/Fixture/Model/EntityWithDoctrineProxy.php b/Neos.Flow/Tests/Unit/Reflection/Fixture/Model/EntityWithDoctrineProxy.php index bf285f1f8c..69d94d1e6b 100644 --- a/Neos.Flow/Tests/Unit/Reflection/Fixture/Model/EntityWithDoctrineProxy.php +++ b/Neos.Flow/Tests/Unit/Reflection/Fixture/Model/EntityWithDoctrineProxy.php @@ -1,4 +1,5 @@ __initializer__ = $initializer; } @@ -96,7 +97,7 @@ public function __getInitializer() * {@inheritDoc} * @internal generated method: use only when explicitly handling proxy specific loading logic */ - public function __setCloner(\Closure $cloner = null) + public function __setCloner(?\Closure $cloner = null) { $this->__cloner__ = $cloner; } diff --git a/Neos.FluidAdaptor/Classes/Command/DocumentationCommandController.php b/Neos.FluidAdaptor/Classes/Command/DocumentationCommandController.php index 496967fa59..de0f6a5821 100644 --- a/Neos.FluidAdaptor/Classes/Command/DocumentationCommandController.php +++ b/Neos.FluidAdaptor/Classes/Command/DocumentationCommandController.php @@ -1,4 +1,5 @@ request = $request; parent::__construct($options); diff --git a/Neos.FluidAdaptor/Tests/Unit/View/TemplatePathsTest.php b/Neos.FluidAdaptor/Tests/Unit/View/TemplatePathsTest.php index e8bb182e20..9bce8cfee5 100644 --- a/Neos.FluidAdaptor/Tests/Unit/View/TemplatePathsTest.php +++ b/Neos.FluidAdaptor/Tests/Unit/View/TemplatePathsTest.php @@ -1,4 +1,5 @@ __initializer__ = $initializer; } @@ -108,7 +109,7 @@ public function __getInitializer() * {@inheritDoc} * @internal generated method: use only when explicitly handling proxy specific loading logic */ - public function __setCloner(\Closure $cloner = null) + public function __setCloner(?\Closure $cloner = null) { $this->__cloner__ = $cloner; } diff --git a/Neos.Utility.OpcodeCache/Classes/OpcodeCacheHelper.php b/Neos.Utility.OpcodeCache/Classes/OpcodeCacheHelper.php index 91504953be..429fd79b42 100644 --- a/Neos.Utility.OpcodeCache/Classes/OpcodeCacheHelper.php +++ b/Neos.Utility.OpcodeCache/Classes/OpcodeCacheHelper.php @@ -1,4 +1,5 @@