diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/ContentGraphFactory.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/ContentGraphFactory.php index 2599353780a..5f1b45b09a5 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/ContentGraphFactory.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/ContentGraphFactory.php @@ -1,5 +1,7 @@ + */ +class DeclareStrictTypesRule implements Rule +{ + public function getNodeType(): string + { + return FileNode::class; + } + + public function processNode(Node $node, Scope $scope): array + { + assert($node instanceof FileNode); + $nodes = $node->getNodes(); + if (0 === \count($nodes)) { + return []; + } + $firstNode = \array_shift($nodes); + + if ($firstNode instanceof Node\Stmt\Declare_) { + foreach ($firstNode->declares as $declare) { + if ( + $declare->value instanceof Node\Scalar\LNumber + && $declare->key->toLowerString() === 'strict_types' + && $declare->value->value === 1 + ) { + return []; + } + } + } + + return [ + 'File is missing a "declare(strict_types=1)" declaration.', + ]; + } +} diff --git a/Neos.ContentRepository.Core/Classes/Factory/ContentRepositoryServiceFactoryInterface.php b/Neos.ContentRepository.Core/Classes/Factory/ContentRepositoryServiceFactoryInterface.php index 3d6923659e0..fdcb1bf7d39 100644 --- a/Neos.ContentRepository.Core/Classes/Factory/ContentRepositoryServiceFactoryInterface.php +++ b/Neos.ContentRepository.Core/Classes/Factory/ContentRepositoryServiceFactoryInterface.php @@ -1,5 +1,7 @@ userService->updateUser($user); $this->addFlashMessage( - $this->translator->translateById('userSettings.electronicAddressRemoved.body', [htmlspecialchars($electronicAddress->getIdentifier()), htmlspecialchars($electronicAddress->getType()), htmlspecialchars($user->getName())], null, null, 'Modules', 'Neos.Neos'), + $this->translator->translateById('userSettings.electronicAddressRemoved.body', [htmlspecialchars($electronicAddress->getIdentifier()), htmlspecialchars($electronicAddress->getType()), htmlspecialchars((string)$user->getName())], null, null, 'Modules', 'Neos.Neos'), $this->translator->translateById('userSettings.electronicAddressRemoved.title', [], null, null, 'Modules', 'Neos.Neos'), Message::SEVERITY_NOTICE, [], diff --git a/Neos.Neos/Classes/Domain/NodeLabel/ExpressionBasedNodeLabelGenerator.php b/Neos.Neos/Classes/Domain/NodeLabel/ExpressionBasedNodeLabelGenerator.php index ae6c9a291bc..95ff8df9655 100644 --- a/Neos.Neos/Classes/Domain/NodeLabel/ExpressionBasedNodeLabelGenerator.php +++ b/Neos.Neos/Classes/Domain/NodeLabel/ExpressionBasedNodeLabelGenerator.php @@ -1,5 +1,7 @@ xliffToJsonTranslationsCache->has($cacheIdentifier)) { $json = $this->xliffToJsonTranslationsCache->get($cacheIdentifier); diff --git a/Neos.Neos/Classes/Utility/User.php b/Neos.Neos/Classes/Utility/User.php index 9ecaaf1d110..5275452f696 100644 --- a/Neos.Neos/Classes/Utility/User.php +++ b/Neos.Neos/Classes/Utility/User.php @@ -1,5 +1,7 @@