diff --git a/Classes/Application/ReloadNodes/NodeMap.php b/Classes/Application/ReloadNodes/NodeMap.php index 38b08093ce..6cde0b85fe 100644 --- a/Classes/Application/ReloadNodes/NodeMap.php +++ b/Classes/Application/ReloadNodes/NodeMap.php @@ -59,6 +59,6 @@ public function jsonSerialize(): mixed $result[$item->getNodeAddressAsString()] = $item; } - return $result ? $result : new \stdClass; + return $result ? $result : new \stdClass(); } } diff --git a/Classes/Application/ReloadNodes/ReloadNodesQueryHandler.php b/Classes/Application/ReloadNodes/ReloadNodesQueryHandler.php index b43606c7f6..46505c951b 100644 --- a/Classes/Application/ReloadNodes/ReloadNodesQueryHandler.php +++ b/Classes/Application/ReloadNodes/ReloadNodesQueryHandler.php @@ -109,7 +109,8 @@ public function handle(ReloadNodesQuery $query, ActionRequest $actionRequest): R $ancestors, $subgraph ) { - if ($level < $this->loadingDepth || // load all nodes within loadingDepth + if ( + $level < $this->loadingDepth || // load all nodes within loadingDepth $this->loadingDepth === 0 || // unlimited loadingDepth // load toggled nodes $query->toggledNodesIds->contain($baseNode->aggregateId) || @@ -119,10 +120,12 @@ public function handle(ReloadNodesQuery $query, ActionRequest $actionRequest): R iterator_to_array($ancestors) )) ) { - foreach ($subgraph->findChildNodes( - $baseNode->aggregateId, - FindChildNodesFilter::create(nodeTypes: $baseNodeTypeConstraints) - ) as $childNode) { + foreach ( + $subgraph->findChildNodes( + $baseNode->aggregateId, + FindChildNodesFilter::create(nodeTypes: $baseNodeTypeConstraints) + ) as $childNode + ) { $nodeMapBuilder->addNode($childNode); $gatherNodesRecursively($nodeMapBuilder, $childNode, $level + 1); } diff --git a/Classes/ContentRepository/Service/NeosUiNodeService.php b/Classes/ContentRepository/Service/NeosUiNodeService.php index 63fdad72e5..5078ef8d09 100644 --- a/Classes/ContentRepository/Service/NeosUiNodeService.php +++ b/Classes/ContentRepository/Service/NeosUiNodeService.php @@ -1,4 +1,5 @@ getOptions()['nodeCreationHandlers']) - || !is_array($nodeType->getOptions()['nodeCreationHandlers'])) { + if ( + !isset($nodeType->getOptions()['nodeCreationHandlers']) + || !is_array($nodeType->getOptions()['nodeCreationHandlers']) + ) { return $commands; } foreach ((new PositionalArraySorter($nodeType->getOptions()['nodeCreationHandlers']))->toArray() as $key => $nodeCreationHandlerConfiguration) { diff --git a/Classes/Domain/Model/Changes/AbstractStructuralChange.php b/Classes/Domain/Model/Changes/AbstractStructuralChange.php index 71e99a521e..73db59de1e 100644 --- a/Classes/Domain/Model/Changes/AbstractStructuralChange.php +++ b/Classes/Domain/Model/Changes/AbstractStructuralChange.php @@ -1,5 +1,7 @@ updateWorkspaceInfo(); - if ($this->getNodeType($node)?->isOfType('Neos.Neos:Content') - && ($this->getParentDomAddress() || $this->getSiblingDomAddress())) { + if ( + $this->getNodeType($node)?->isOfType('Neos.Neos:Content') + && ($this->getParentDomAddress() || $this->getSiblingDomAddress()) + ) { // we can ONLY render out of band if: // 1) the parent of our new (or copied or moved) node is a ContentCollection; // so we can directly update an element of this content collection - if ($parentNode && $this->getNodeType($parentNode)?->isOfType('Neos.Neos:ContentCollection') && + if ( + $parentNode && $this->getNodeType($parentNode)?->isOfType('Neos.Neos:ContentCollection') && // 2) the parent DOM address (i.e. the closest RENDERED node in DOM is actually the ContentCollection; // and no other node in between $this->getParentDomAddress() && diff --git a/Classes/Domain/Model/Changes/CopyAfter.php b/Classes/Domain/Model/Changes/CopyAfter.php index c3e8307719..8445ea68ff 100644 --- a/Classes/Domain/Model/Changes/CopyAfter.php +++ b/Classes/Domain/Model/Changes/CopyAfter.php @@ -1,5 +1,7 @@ findParentNode($succeedingSibling) : null; $subject = $this->subject; - if ($this->canApply() && !is_null($succeedingSibling) + if ( + $this->canApply() && !is_null($succeedingSibling) && !is_null($parentNodeOfSucceedingSibling) ) { if (!$subject->dimensionSpacePoint->equals($succeedingSibling->dimensionSpacePoint)) { diff --git a/Classes/Domain/Model/Changes/Create.php b/Classes/Domain/Model/Changes/Create.php index 431ab888be..4ae52e68a9 100644 --- a/Classes/Domain/Model/Changes/Create.php +++ b/Classes/Domain/Model/Changes/Create.php @@ -1,5 +1,7 @@ subject; $parentNode = $this->findParentNode($this->subject); - if ($this->canApply() + if ( + $this->canApply() && !is_null($precedingSibling) && !is_null($parentNodeOfPreviousSibling) && !is_null($parentNode) diff --git a/Classes/Domain/Model/Changes/MoveBefore.php b/Classes/Domain/Model/Changes/MoveBefore.php index d71d2c7566..4e5b35d4d1 100644 --- a/Classes/Domain/Model/Changes/MoveBefore.php +++ b/Classes/Domain/Model/Changes/MoveBefore.php @@ -1,5 +1,7 @@ subject; $parentNode = $this->findParentNode($subject); $succeedingSiblingParent = $succeedingSibling ? $this->findParentNode($succeedingSibling) : null; - if ($this->canApply() && !is_null($succeedingSibling) + if ( + $this->canApply() && !is_null($succeedingSibling) && !is_null($parentNode) && !is_null($succeedingSiblingParent) ) { $precedingSibling = null; diff --git a/Classes/Domain/Model/Changes/MoveInto.php b/Classes/Domain/Model/Changes/MoveInto.php index 95dad1c83e..6f79b8fbcb 100644 --- a/Classes/Domain/Model/Changes/MoveInto.php +++ b/Classes/Domain/Model/Changes/MoveInto.php @@ -1,5 +1,7 @@ getIsInline() + if ( + !$this->getIsInline() && ( $this->getNodeType($node)?->getConfiguration($reloadIfChangedConfigurationPathForProperty) || $this->getNodeType($node)?->getConfiguration($reloadIfChangedConfigurationPathForReference) @@ -200,9 +203,11 @@ private function createFeedback(Node $subject): void ) { if (!$this->getNodeDomAddress()) { $this->reloadDocument($node); - } elseif ($this->getNodeDomAddress()->getFusionPath() + } elseif ( + $this->getNodeDomAddress()->getFusionPath() && $parentNode - && $this->getNodeType($parentNode)?->isOfType('Neos.Neos:ContentCollection')) { + && $this->getNodeType($parentNode)?->isOfType('Neos.Neos:ContentCollection') + ) { $reloadContentOutOfBand = new ReloadContentOutOfBand(); $reloadContentOutOfBand->setNode($node); $reloadContentOutOfBand->setNodeDomAddress($this->getNodeDomAddress()); @@ -214,7 +219,8 @@ private function createFeedback(Node $subject): void $reloadPageIfChangedConfigurationPathForProperty = sprintf('properties.%s.ui.reloadPageIfChanged', $propertyName); $reloadPageIfChangedConfigurationPathForReference = sprintf('references.%s.ui.reloadPageIfChanged', $propertyName); - if (!$this->getIsInline() + if ( + !$this->getIsInline() && ( $this->getNodeType($node)?->getConfiguration($reloadPageIfChangedConfigurationPathForProperty) || $this->getNodeType($node)?->getConfiguration($reloadPageIfChangedConfigurationPathForReference) diff --git a/Classes/Domain/Model/Changes/Remove.php b/Classes/Domain/Model/Changes/Remove.php index 379e4276e6..f4547634d3 100644 --- a/Classes/Domain/Model/Changes/Remove.php +++ b/Classes/Domain/Model/Changes/Remove.php @@ -1,5 +1,7 @@ toJson(), $toggledNodes) || @@ -118,10 +119,12 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) iterator_to_array($ancestors) )) ) { - foreach ($subgraph->findChildNodes( - $baseNode->aggregateId, - FindChildNodesFilter::create(nodeTypes: $baseNodeTypeConstraints) - ) as $childNode) { + foreach ( + $subgraph->findChildNodes( + $baseNode->aggregateId, + FindChildNodesFilter::create(nodeTypes: $baseNodeTypeConstraints) + ) as $childNode + ) { $nodes[$childNode->aggregateId->value] = $childNode; $gatherNodesRecursively($nodes, $childNode, $level + 1); } diff --git a/Classes/FlowQueryOperations/NeosUiFilteredChildrenOperation.php b/Classes/FlowQueryOperations/NeosUiFilteredChildrenOperation.php index 7a080d010d..86f6f4b1d6 100644 --- a/Classes/FlowQueryOperations/NeosUiFilteredChildrenOperation.php +++ b/Classes/FlowQueryOperations/NeosUiFilteredChildrenOperation.php @@ -1,4 +1,5 @@ getContext() as $contextNode) { $subgraph = $this->contentRepositoryRegistry->subgraphForNode($contextNode); - foreach ($subgraph->findChildNodes( - $contextNode->aggregateId, - FindChildNodesFilter::create(nodeTypes: $arguments[0] ?? null) - ) as $childNode) { + foreach ( + $subgraph->findChildNodes( + $contextNode->aggregateId, + FindChildNodesFilter::create(nodeTypes: $arguments[0] ?? null) + ) as $childNode + ) { if (!isset($outputNodeIdentifiers[$childNode->aggregateId->value])) { $output[] = $childNode; $outputNodeIdentifiers[$childNode->aggregateId->value] = true; diff --git a/Classes/FlowQueryOperations/SearchOperation.php b/Classes/FlowQueryOperations/SearchOperation.php index 11d2405f0d..8b33a18699 100644 --- a/Classes/FlowQueryOperations/SearchOperation.php +++ b/Classes/FlowQueryOperations/SearchOperation.php @@ -1,4 +1,5 @@ aggregateId->value, $renderedNodes)) { $renderedNodes[$node->aggregateId->value]['matched'] = true; - } elseif ($renderedNode = $this->renderNodeWithMinimalPropertiesAndChildrenInformation( - $node, - $actionRequest, - $nodeTypeFilter ?? $baseNodeTypeOverride, - $includeContentChildNodes - )) { + } elseif ( + $renderedNode = $this->renderNodeWithMinimalPropertiesAndChildrenInformation( + $node, + $actionRequest, + $nodeTypeFilter ?? $baseNodeTypeOverride, + $includeContentChildNodes + ) + ) { $renderedNode['matched'] = true; $renderedNodes[$node->aggregateId->value] = $renderedNode; } else { diff --git a/Classes/Fusion/Helper/StaticResourcesHelper.php b/Classes/Fusion/Helper/StaticResourcesHelper.php index c7911e8f8c..e0f1befac3 100644 --- a/Classes/Fusion/Helper/StaticResourcesHelper.php +++ b/Classes/Fusion/Helper/StaticResourcesHelper.php @@ -1,4 +1,5 @@ getNodeTypeManager()) implements NodeCreationHandlerInterface { + return new class ($contentRepository->getNodeTypeManager()) implements NodeCreationHandlerInterface { public function __construct( private readonly NodeTypeManager $nodeTypeManager ) { diff --git a/Classes/Infrastructure/Neos/UriPathSegmentNodeCreationHandlerFactory.php b/Classes/Infrastructure/Neos/UriPathSegmentNodeCreationHandlerFactory.php index 92ae008ced..a505b5a6df 100644 --- a/Classes/Infrastructure/Neos/UriPathSegmentNodeCreationHandlerFactory.php +++ b/Classes/Infrastructure/Neos/UriPathSegmentNodeCreationHandlerFactory.php @@ -36,7 +36,7 @@ final class UriPathSegmentNodeCreationHandlerFactory implements NodeCreationHand public function build(ContentRepository $contentRepository): NodeCreationHandlerInterface { - return new class($contentRepository->getNodeTypeManager(), $this->transliterationService) implements NodeCreationHandlerInterface { + return new class ($contentRepository->getNodeTypeManager(), $this->transliterationService) implements NodeCreationHandlerInterface { public function __construct( private readonly NodeTypeManager $nodeTypeManager, private readonly TransliterationService $transliterationService diff --git a/Classes/Service/NodeClipboard.php b/Classes/Service/NodeClipboard.php index 2f009b6795..5fa6c5a40b 100644 --- a/Classes/Service/NodeClipboard.php +++ b/Classes/Service/NodeClipboard.php @@ -1,4 +1,5 @@ nodePropertyValidationService->validate( 'test', 'Neos.Neos/Validation/StringLengthValidator', - ['minimum' => 1, 'maximum' => 2]); + ['minimum' => 1, 'maximum' => 2] + ); Assert::assertFalse($result); } @@ -76,7 +78,8 @@ public function ifNoBackendValidatorCanBeFoundValidationReturnsTrue(): void $result = $this->nodePropertyValidationService->validate( 'test', 'My.Own/Validation/StringLengthValidator', - ['minimum' => 1, 'maximum' => 255]); + ['minimum' => 1, 'maximum' => 255] + ); Assert::assertTrue($result); } diff --git a/Tests/IntegrationTests/TestDistribution/DistributionPackages/Neos.TestNodeTypes/Classes/Application/RemoveAdditionalSettings/RemoveAdditionalSettingsCommand.php b/Tests/IntegrationTests/TestDistribution/DistributionPackages/Neos.TestNodeTypes/Classes/Application/RemoveAdditionalSettings/RemoveAdditionalSettingsCommand.php index bba253a1b6..96458b0dbc 100644 --- a/Tests/IntegrationTests/TestDistribution/DistributionPackages/Neos.TestNodeTypes/Classes/Application/RemoveAdditionalSettings/RemoveAdditionalSettingsCommand.php +++ b/Tests/IntegrationTests/TestDistribution/DistributionPackages/Neos.TestNodeTypes/Classes/Application/RemoveAdditionalSettings/RemoveAdditionalSettingsCommand.php @@ -19,8 +19,8 @@ #[Flow\Proxy(false)] final class RemoveAdditionalSettingsCommand { - public function __construct( - ) { + public function __construct() + { } public static function fromArray(array $array): self diff --git a/Tests/IntegrationTests/TestDistribution/DistributionPackages/Neos.TestNodeTypes/Classes/DataSources/NodeWithDependingPropertiesDataSource.php b/Tests/IntegrationTests/TestDistribution/DistributionPackages/Neos.TestNodeTypes/Classes/DataSources/NodeWithDependingPropertiesDataSource.php index 25d8bee8bf..0f595b4716 100644 --- a/Tests/IntegrationTests/TestDistribution/DistributionPackages/Neos.TestNodeTypes/Classes/DataSources/NodeWithDependingPropertiesDataSource.php +++ b/Tests/IntegrationTests/TestDistribution/DistributionPackages/Neos.TestNodeTypes/Classes/DataSources/NodeWithDependingPropertiesDataSource.php @@ -1,4 +1,5 @@ 'label_'. $option, + 'label' => 'label_' . $option, 'value' => $option, ]; }, diff --git a/Tests/Unit/CreationDialogNodeTypePostprocessorTest.php b/Tests/Unit/CreationDialogNodeTypePostprocessorTest.php index 76563cb57d..8ffde294ad 100644 --- a/Tests/Unit/CreationDialogNodeTypePostprocessorTest.php +++ b/Tests/Unit/CreationDialogNodeTypePostprocessorTest.php @@ -1,4 +1,5 @@ processConfigurationLegacyOnlyOnce($configuration, [], []); self::assertSame($configuration, $result); - } /** diff --git a/Tests/Unit/Domain/Model/RenderedNodeDomAddressTest.php b/Tests/Unit/Domain/Model/RenderedNodeDomAddressTest.php index b78eb7cc73..4a332654be 100644 --- a/Tests/Unit/Domain/Model/RenderedNodeDomAddressTest.php +++ b/Tests/Unit/Domain/Model/RenderedNodeDomAddressTest.php @@ -1,4 +1,5 @@ + + The PSR12 coding standard – without line length limitation + + + + ./Classes + ./Tests + + php + + + + +