diff --git a/Neos.ContentRepository/Classes/Domain/Model/Node.php b/Neos.ContentRepository/Classes/Domain/Model/Node.php index c7cdf56b2b7..0bddfc4d93c 100644 --- a/Neos.ContentRepository/Classes/Domain/Model/Node.php +++ b/Neos.ContentRepository/Classes/Domain/Model/Node.php @@ -922,6 +922,7 @@ public function getProperty($propertyName, bool $returnNodesAsIdentifiers = fals } if ( + /** @phpstan-ignore-next-line i will not touch this code */ isset($expectedPropertyType) && $expectedPropertyType === 'Neos\Media\Domain\Model\ImageInterface' && empty($value) diff --git a/Neos.ContentRepository/Classes/Domain/NodeType/NodeTypeConstraintFactory.php b/Neos.ContentRepository/Classes/Domain/NodeType/NodeTypeConstraintFactory.php index c96c1acbeef..c45ea4791a7 100644 --- a/Neos.ContentRepository/Classes/Domain/NodeType/NodeTypeConstraintFactory.php +++ b/Neos.ContentRepository/Classes/Domain/NodeType/NodeTypeConstraintFactory.php @@ -68,7 +68,7 @@ public function parseFilterString(string $serializedFilters): NodeTypeConstraint // in case there are no filters, we fall back to allowing every node type. // Furthermore, if there are only negated filters, we also fall back to allowing every node type (when the excludelist does not match) - $wildcardAllowed = empty($serializedFilters) || (!empty($serializedFilters) && $onlyNegatedFilters); + $wildcardAllowed = empty($serializedFilters) || $onlyNegatedFilters; return new NodeTypeConstraints($wildcardAllowed, $explicitlyAllowedNodeTypeNames, $explicitlyDisallowedNodeTypeNames); } diff --git a/Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php b/Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php index 00ee9e65488..d36739d364e 100644 --- a/Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php +++ b/Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php @@ -181,7 +181,7 @@ public function findByNodeIdentifier($nodeIdentifier) * @param array $dimensions An array of dimensions with array of ordered values to use for fallback matching * @param boolean|NULL $removedNodes Include removed nodes, NULL (all), false (no removed nodes) or true (only removed nodes) * @throws \InvalidArgumentException - * @return NodeData The matching node if found, otherwise NULL + * @return NodeData|null The matching node if found, otherwise NULL */ public function findOneByPath($path, Workspace $workspace, array $dimensions = null, $removedNodes = false) { @@ -321,7 +321,7 @@ public function findOneByPathInContext($path, Context $context) * @param Workspace $workspace The containing workspace * @param array $dimensions An array of dimensions with array of ordered values to use for fallback matching * @param bool $removedNodes If shadow nodes should be considered while finding the specified node - * @return NodeData The matching node if found, otherwise NULL + * @return NodeData|null The matching node if found, otherwise NULL */ public function findOneByIdentifier($identifier, Workspace $workspace, array $dimensions = null, $removedNodes = false) { diff --git a/Neos.Diff/Classes/SequenceMatcher.php b/Neos.Diff/Classes/SequenceMatcher.php index c1f61245dcf..5ac09747b24 100644 --- a/Neos.Diff/Classes/SequenceMatcher.php +++ b/Neos.Diff/Classes/SequenceMatcher.php @@ -597,7 +597,7 @@ public function getGroupedOpcodes($context = 3) ]; } - if (!empty($group) && !(count($group) == 1 && $group[0][0] == 'equal')) { + if (!(count($group) == 1 && $group[0][0] == 'equal')) { $groups[] = $group; } diff --git a/Neos.Fusion/Classes/Core/ExceptionHandlers/PlainTextHandler.php b/Neos.Fusion/Classes/Core/ExceptionHandlers/PlainTextHandler.php index 1c221f70e8b..85e35ed8e0a 100644 --- a/Neos.Fusion/Classes/Core/ExceptionHandlers/PlainTextHandler.php +++ b/Neos.Fusion/Classes/Core/ExceptionHandlers/PlainTextHandler.php @@ -22,7 +22,7 @@ class PlainTextHandler extends AbstractRenderingExceptionHandler * * @param string $fusionPath path causing the exception * @param \Exception $exception exception to handle - * @param integer $referenceCode + * @param integer|null $referenceCode * @return string */ protected function handle($fusionPath, \Exception $exception, $referenceCode) diff --git a/Neos.Fusion/Classes/Core/ExceptionHandlers/XmlCommentHandler.php b/Neos.Fusion/Classes/Core/ExceptionHandlers/XmlCommentHandler.php index 59d874c0317..c23437f6e52 100644 --- a/Neos.Fusion/Classes/Core/ExceptionHandlers/XmlCommentHandler.php +++ b/Neos.Fusion/Classes/Core/ExceptionHandlers/XmlCommentHandler.php @@ -51,7 +51,7 @@ public function injectThrowableStorage(ThrowableStorageInterface $throwableStora * * @param string $fusionPath path causing the exception * @param \Exception $exception exception to handle - * @param integer $referenceCode + * @param integer|null $referenceCode * @return string */ protected function handle($fusionPath, \Exception $exception, $referenceCode) diff --git a/Neos.Fusion/Classes/Core/ObjectTreeParser/FilePatternResolver.php b/Neos.Fusion/Classes/Core/ObjectTreeParser/FilePatternResolver.php index 662bbb136e9..4e72515766d 100644 --- a/Neos.Fusion/Classes/Core/ObjectTreeParser/FilePatternResolver.php +++ b/Neos.Fusion/Classes/Core/ObjectTreeParser/FilePatternResolver.php @@ -104,6 +104,7 @@ protected static function resolveRelativePath(string $filePattern, ?string $file */ protected static function parseGlobPatternAndResolveFiles(string $filePattern, string $defaultFileNameEnd): array { + $matches = null; $fileIteratorCreator = match (1) { // We use the flag SKIP_DOTS, as it might not be allowed to access `..` and we only are interested in files // We use the flag UNIX_PATHS, so that stream wrapper paths are always valid on windows https://github.com/neos/neos-development-collection/issues/4358 diff --git a/Neos.Fusion/Classes/Core/RuntimeConfiguration.php b/Neos.Fusion/Classes/Core/RuntimeConfiguration.php index 39bfcaaaeb5..772af1df17a 100644 --- a/Neos.Fusion/Classes/Core/RuntimeConfiguration.php +++ b/Neos.Fusion/Classes/Core/RuntimeConfiguration.php @@ -93,6 +93,7 @@ public function forPath(string $fusionPath): array // Build configuration for the remaining path parts $remainingPath = substr($fusionPath, $pathUntilNow === '' ? 0 : strlen($pathUntilNow) + 1); + /** @var non-empty-list $pathParts */ $pathParts = explode('/', $remainingPath); foreach ($pathParts as $pathPart) { if ($pathUntilNow === '') { @@ -106,6 +107,7 @@ public function forPath(string $fusionPath): array continue; } + /** @phpstan-ignore-next-line $configuration is set */ $configuration = $this->matchCurrentPathPart($pathPart, $configuration, $currentPrototypeDefinitions); $this->pathCache[$pathUntilNow]['c'] = $configuration; $this->pathCache[$pathUntilNow]['p'] = $currentPrototypeDefinitions; diff --git a/Neos.Fusion/Classes/Service/DebugStack.php b/Neos.Fusion/Classes/Service/DebugStack.php index 9af28e686d5..fc0560090cf 100644 --- a/Neos.Fusion/Classes/Service/DebugStack.php +++ b/Neos.Fusion/Classes/Service/DebugStack.php @@ -40,7 +40,7 @@ public function dump() $this->flush(); $output = ''; foreach ($data as $debugMessage) { - /** @phpstan-ignore-next-line var_dump is not properly autoloadet */ + /** @phpstan-ignore-next-line var_dump is not properly autoloaded */ $output .= \Neos\Flow\var_dump($debugMessage->getData(), $debugMessage->getTitle(), true, $debugMessage->isPlaintext()); } return $output; diff --git a/Neos.Media.Browser/Classes/Controller/AssetController.php b/Neos.Media.Browser/Classes/Controller/AssetController.php index 38cfba8658a..df10decc2a4 100644 --- a/Neos.Media.Browser/Classes/Controller/AssetController.php +++ b/Neos.Media.Browser/Classes/Controller/AssetController.php @@ -289,7 +289,7 @@ public function indexAction($view = null, $sortBy = null, $sortDirection = null, $allCollectionsCount = $this->assetRepository->countAll(); $allCount = ($activeAssetCollection ? $this->assetRepository->countByAssetCollection($activeAssetCollection) : $allCollectionsCount); - $searchResultCount = isset($assetProxies) ? $assetProxies->count() : 0; + $searchResultCount = $assetProxies->count(); $untaggedCount = ($assetProxyRepository instanceof SupportsTaggingInterface ? $assetProxyRepository->countUntagged() : 0); } catch (AssetSourceConnectionExceptionInterface $e) { $this->view->assign('connectionError', $e); diff --git a/Neos.Media/Classes/Domain/Model/AssetSource/Neos/NeosAssetProxyQueryResult.php b/Neos.Media/Classes/Domain/Model/AssetSource/Neos/NeosAssetProxyQueryResult.php index fcadf0ee23e..670e79c8b78 100644 --- a/Neos.Media/Classes/Domain/Model/AssetSource/Neos/NeosAssetProxyQueryResult.php +++ b/Neos.Media/Classes/Domain/Model/AssetSource/Neos/NeosAssetProxyQueryResult.php @@ -17,7 +17,6 @@ use Neos\Flow\Annotations\Proxy; use Neos\Flow\Persistence\QueryResultInterface; use Neos\Media\Domain\Model\AssetInterface; -use ReturnTypeWillChange; /** * @Proxy(false) @@ -101,7 +100,7 @@ public function current(): ?AssetProxyInterface /** * @return void */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function next() { $this->flowPersistenceQueryResult->next(); @@ -110,7 +109,7 @@ public function next() /** * @return AssetProxyInterface|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function key() { return $this->flowPersistenceQueryResult->key(); @@ -119,7 +118,7 @@ public function key() /** * @return bool */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function valid() { return $this->flowPersistenceQueryResult->valid(); @@ -138,7 +137,7 @@ public function rewind() * @param mixed $offset * @return bool */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($offset) { return $this->flowPersistenceQueryResult->offsetExists($offset); @@ -148,7 +147,7 @@ public function offsetExists($offset) * @param mixed $offset * @return AssetProxyInterface|mixed */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset): ?AssetProxyInterface { return new NeosAssetProxy($this->flowPersistenceQueryResult->offsetGet($offset), $this->assetSource); @@ -158,7 +157,7 @@ public function offsetGet($offset): ?AssetProxyInterface * @param mixed $offset * @param mixed $value */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { throw new \RuntimeException('Unsupported operation: ' . __METHOD__, 1510060444); @@ -167,7 +166,7 @@ public function offsetSet($offset, $value) /** * @param mixed $offset */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($offset) { throw new \RuntimeException('Unsupported operation: ' . __METHOD__, 1510060467); diff --git a/Neos.Neos/Classes/Aspects/NodeTypeConfigurationEnrichmentAspect.php b/Neos.Neos/Classes/Aspects/NodeTypeConfigurationEnrichmentAspect.php index a01aacf6f76..33cf9f2aee5 100644 --- a/Neos.Neos/Classes/Aspects/NodeTypeConfigurationEnrichmentAspect.php +++ b/Neos.Neos/Classes/Aspects/NodeTypeConfigurationEnrichmentAspect.php @@ -131,7 +131,7 @@ protected function setPropertyLabels($nodeTypeName, array &$configuration, array * Resolve help message thumbnail url * * @param string $nodeTypeName - * @param string $configurationThumbnail + * @param string|null $configurationThumbnail * @return string $thumbnailUrl */ protected function resolveHelpMessageThumbnail($nodeTypeName, $configurationThumbnail) @@ -168,7 +168,7 @@ protected function applyEditorLabels($nodeTypeLabelIdPrefix, $propertyName, $edi { switch ($editorName) { case 'Neos.Neos/Inspector/Editors/SelectBoxEditor': - if (isset($editorOptions) && $this->shouldFetchTranslation($editorOptions, 'placeholder')) { + if ($this->shouldFetchTranslation($editorOptions, 'placeholder')) { $editorOptions['placeholder'] = $translationIdGenerator('selectBoxEditor.placeholder'); } @@ -190,12 +190,12 @@ protected function applyEditorLabels($nodeTypeLabelIdPrefix, $propertyName, $edi } break; case 'Neos.Neos/Inspector/Editors/TextFieldEditor': - if (isset($editorOptions) && $this->shouldFetchTranslation($editorOptions, 'placeholder')) { + if ($this->shouldFetchTranslation($editorOptions, 'placeholder')) { $editorOptions['placeholder'] = $translationIdGenerator('textFieldEditor.placeholder'); } break; case 'Neos.Neos/Inspector/Editors/TextAreaEditor': - if (isset($editorOptions) && $this->shouldFetchTranslation($editorOptions, 'placeholder')) { + if ($this->shouldFetchTranslation($editorOptions, 'placeholder')) { $editorOptions['placeholder'] = $translationIdGenerator('textAreaEditor.placeholder'); } break; diff --git a/Neos.Neos/Classes/Controller/Backend/ModuleController.php b/Neos.Neos/Classes/Controller/Backend/ModuleController.php index 9e5e9f1dd13..612b85d402b 100644 --- a/Neos.Neos/Classes/Controller/Backend/ModuleController.php +++ b/Neos.Neos/Classes/Controller/Backend/ModuleController.php @@ -93,7 +93,7 @@ public function indexAction(array $module) $moduleRequest->setArgument('__moduleConfiguration', $moduleConfiguration); - $moduleResponse = new ActionResponse($this->response); + $moduleResponse = new ActionResponse(); $this->dispatcher->dispatch($moduleRequest, $moduleResponse); diff --git a/Neos.Neos/Classes/Domain/Repository/DomainRepository.php b/Neos.Neos/Classes/Domain/Repository/DomainRepository.php index 9dcb10af18b..6c720a18f49 100644 --- a/Neos.Neos/Classes/Domain/Repository/DomainRepository.php +++ b/Neos.Neos/Classes/Domain/Repository/DomainRepository.php @@ -15,6 +15,7 @@ use Neos\Flow\Core\Bootstrap; use Neos\Flow\Http\HttpRequestHandlerInterface; use Neos\Flow\Persistence\QueryInterface; +use Neos\Flow\Persistence\QueryResultInterface; use Neos\Flow\Persistence\Repository; use Neos\Neos\Domain\Model\Domain; use Neos\Neos\Domain\Service\DomainMatchingStrategy; @@ -22,6 +23,7 @@ /** * The Site Repository * + * @method QueryResultInterface findByActive(boolean $active) * @Flow\Scope("singleton") * @api */ diff --git a/Neos.Neos/Classes/Domain/Repository/SiteRepository.php b/Neos.Neos/Classes/Domain/Repository/SiteRepository.php index b6b60af7a08..676bd95e8f4 100644 --- a/Neos.Neos/Classes/Domain/Repository/SiteRepository.php +++ b/Neos.Neos/Classes/Domain/Repository/SiteRepository.php @@ -21,6 +21,7 @@ /** * The Site Repository * + * @method QueryResultInterface findByState(int $state) * @Flow\Scope("singleton") * @api */ diff --git a/Neos.Neos/Classes/Service/Controller/AbstractServiceController.php b/Neos.Neos/Classes/Service/Controller/AbstractServiceController.php index 02b7f26e7d4..f643c7346e0 100644 --- a/Neos.Neos/Classes/Service/Controller/AbstractServiceController.php +++ b/Neos.Neos/Classes/Service/Controller/AbstractServiceController.php @@ -110,6 +110,7 @@ public function processRequest(ActionRequest $request, ActionResponse $response) */ protected function convertException(\Exception $exception) { + $exceptionData = []; if ($this->objectManager->getContext()->isProduction()) { if ($exception instanceof FlowException) { $exceptionData['message'] = 'When contacting the maintainer of this application please mention the following reference code:

' . $exception->getReferenceCode(); diff --git a/Neos.Neos/Classes/ViewHelpers/Backend/IfModuleAccessibleViewHelper.php b/Neos.Neos/Classes/ViewHelpers/Backend/IfModuleAccessibleViewHelper.php index 2e21b860bf9..24c97d6f915 100644 --- a/Neos.Neos/Classes/ViewHelpers/Backend/IfModuleAccessibleViewHelper.php +++ b/Neos.Neos/Classes/ViewHelpers/Backend/IfModuleAccessibleViewHelper.php @@ -82,6 +82,7 @@ protected static function evaluateCondition($arguments, RenderingContextInterfac if (!$privilegeManager->isGranted(ModulePrivilege::class, new ModulePrivilegeSubject($arguments['modulePath']))) { return false; } + /** @phpstan-ignore-next-line condition will be fixed with Neos 9 */ if (isset($moduleConfiguration['privilegeTarget'])) { return $privilegeManager->isPrivilegeTargetGranted($arguments['moduleConfiguration']['privilegeTarget']); } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index a3d2134c686..1a163a88817 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,5 +1,5 @@ parameters: - level: 0 + level: 1 ignoreErrors: # Errors caused by the backport of the ESCR TraversableNodeInterface - '#has invalid return type Neos\\ContentRepository\\DimensionSpace\\DimensionSpace\\DimensionSpacePoint.$#'