From 31055c7e379d05f567209092dc7b17da9246c068 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Fri, 2 Feb 2024 13:02:34 +0000 Subject: [PATCH 1/4] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index c6621c5ca36..d4b70ccdd68 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2024-01-31 +The following reference was automatically generated from code on 2024-02-02 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index 049322afbc1..2b597f1ef63 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index adf0bc7714a..f9dfa084a0b 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 05f1ac389ec..b049b22cc3e 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index baa74056b7d..9f7937a08df 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index bee5ed67ec3..d51f49c1816 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index f8492866aa8..69e4aae1b80 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index 929e1771eec..efb552b6a14 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 0cfb3c26879..e266c5c941c 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index f1d97b7052f..7fbaa70abd8 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index 23de7a23b7b..be499ddceb1 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 47927ba9a61..19bf85643f1 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index 22edee9ebbd..c7dec97af6b 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index 06c64ff8b1c..c2c3c973be1 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index 2c55f9e7e63..bc3f9a9395f 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index 0b9d623954f..368d028b578 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 67ae14534cd..8f5f8980a0a 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2024-01-31 +This reference was automatically generated from code on 2024-02-02 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From 1a0004d14c1bdce636aa5352b269734d44475788 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 18 Jan 2024 21:33:27 +0100 Subject: [PATCH 2/4] TASK: Add php-stan level 0 to 8.3 codebase --- .../ImportExport/NodeImportService.php | 2 +- .../Migration/Configuration/Configuration.php | 2 +- .../Configuration/YamlConfiguration.php | 2 +- Neos.Diff/Classes/SequenceMatcher.php | 2 +- .../ExceptionHandlers/ThrowingHandler.php | 1 + .../ObjectTreeParser/ObjectTreeParser.php | 1 + .../FusionObjects/Helpers/FusionPathProxy.php | 6 ++++++ .../FusionObjects/Helpers/LazyProps.php | 4 ++-- Neos.Fusion/Classes/Service/DebugStack.php | 1 + .../Neos/NeosAssetProxyQueryResult.php | 8 ++++++++ .../Classes/Domain/Service/AssetService.php | 2 +- Neos.Media/Classes/Imagine/Box.php | 3 +++ .../Classes/TypeConverter/ArrayConverter.php | 1 + .../Controller/Frontend/NodeController.php | 4 ++-- .../Controller/Service/AssetsController.php | 4 ++-- .../Controller/Service/NodesController.php | 6 +++--- .../Service/WorkspacesController.php | 4 ++-- .../Domain/Model/UserInterfaceMode.php | 1 + .../Controller/DataSourceController.php | 2 +- .../Service/Controller/NodeController.php | 4 ++-- .../Backend/UserInitialsViewHelper.php | 7 ++----- .../Command/KickstartCommandController.php | 1 - phpstan.neon.dist | 19 +++++++++++++++++++ 23 files changed, 62 insertions(+), 25 deletions(-) create mode 100644 phpstan.neon.dist diff --git a/Neos.ContentRepository/Classes/Domain/Service/ImportExport/NodeImportService.php b/Neos.ContentRepository/Classes/Domain/Service/ImportExport/NodeImportService.php index ad05def92e6..3276a0382ea 100644 --- a/Neos.ContentRepository/Classes/Domain/Service/ImportExport/NodeImportService.php +++ b/Neos.ContentRepository/Classes/Domain/Service/ImportExport/NodeImportService.php @@ -367,7 +367,7 @@ protected function parseDimensionsElement(\XMLReader $reader) * @param \XMLReader $reader reader positioned just after an opening array-tag * @param string $elementName * @param string $currentNodeIdentifier - * @return array the array values + * @return array|null the array values */ protected function parseArrayElements(\XMLReader $reader, $elementName, $currentNodeIdentifier) { diff --git a/Neos.ContentRepository/Classes/Migration/Configuration/Configuration.php b/Neos.ContentRepository/Classes/Migration/Configuration/Configuration.php index 1f66aed7ce7..cd1f47aece0 100644 --- a/Neos.ContentRepository/Classes/Migration/Configuration/Configuration.php +++ b/Neos.ContentRepository/Classes/Migration/Configuration/Configuration.php @@ -98,7 +98,7 @@ abstract protected function loadConfiguration($version); /** * Loads a list of available versions into an array. * - * @return array + * @return void */ abstract protected function registerAvailableVersions(); } diff --git a/Neos.ContentRepository/Classes/Migration/Configuration/YamlConfiguration.php b/Neos.ContentRepository/Classes/Migration/Configuration/YamlConfiguration.php index 1dd30a04a89..e6c591afa37 100644 --- a/Neos.ContentRepository/Classes/Migration/Configuration/YamlConfiguration.php +++ b/Neos.ContentRepository/Classes/Migration/Configuration/YamlConfiguration.php @@ -38,7 +38,7 @@ class YamlConfiguration extends Configuration /** * Loads a list of available versions into an array. * - * @return array + * @return void * @throws MigrationException */ protected function registerAvailableVersions() diff --git a/Neos.Diff/Classes/SequenceMatcher.php b/Neos.Diff/Classes/SequenceMatcher.php index b593cd9ff9d..c1f61245dcf 100644 --- a/Neos.Diff/Classes/SequenceMatcher.php +++ b/Neos.Diff/Classes/SequenceMatcher.php @@ -640,7 +640,7 @@ private function ratioReduce($sum, array $triple) * Quickly return an upper bound ratio for the similarity of the strings. * This is quicker to compute than Ratio(). * - * @return float The calculated ratio. + * @return float|null The calculated ratio. * @todo throw away or make public */ private function quickRatio() diff --git a/Neos.Fusion/Classes/Core/ExceptionHandlers/ThrowingHandler.php b/Neos.Fusion/Classes/Core/ExceptionHandlers/ThrowingHandler.php index 192f1d8059f..d69fc91fcc6 100644 --- a/Neos.Fusion/Classes/Core/ExceptionHandlers/ThrowingHandler.php +++ b/Neos.Fusion/Classes/Core/ExceptionHandlers/ThrowingHandler.php @@ -44,5 +44,6 @@ public function handleRenderingException($fusionPath, \Exception $exception) */ protected function handle($fusionPath, \Exception $exception, $referenceCode) { + throw new \BadMethodCallException(); } } diff --git a/Neos.Fusion/Classes/Core/ObjectTreeParser/ObjectTreeParser.php b/Neos.Fusion/Classes/Core/ObjectTreeParser/ObjectTreeParser.php index adb77d5e0c0..96a0f518a92 100644 --- a/Neos.Fusion/Classes/Core/ObjectTreeParser/ObjectTreeParser.php +++ b/Neos.Fusion/Classes/Core/ObjectTreeParser/ObjectTreeParser.php @@ -47,6 +47,7 @@ /** * Parses a Fusion File to object ast-nodes + * @phpstan-consistent-constructor */ class ObjectTreeParser { diff --git a/Neos.Fusion/Classes/FusionObjects/Helpers/FusionPathProxy.php b/Neos.Fusion/Classes/FusionObjects/Helpers/FusionPathProxy.php index 1e2012d8cd9..dac177ba16a 100644 --- a/Neos.Fusion/Classes/FusionObjects/Helpers/FusionPathProxy.php +++ b/Neos.Fusion/Classes/FusionObjects/Helpers/FusionPathProxy.php @@ -76,6 +76,7 @@ public function __construct(TemplateImplementation $templateImplementation, $pat * @param string $offset * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->partialFusionTree[$offset]); @@ -88,6 +89,7 @@ public function offsetExists($offset) * @param string $offset * @return mixed|FusionPathProxy */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { if (!isset($this->partialFusionTree[$offset])) { @@ -109,6 +111,7 @@ public function offsetGet($offset) * @param mixed $value * @throws UnsupportedProxyMethodException */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { throw new UnsupportedProxyMethodException('Setting a property of a path proxy not supported. (tried to set: ' . $this->path . ' -- ' . $offset . ')', 1372667221); @@ -120,6 +123,7 @@ public function offsetSet($offset, $value) * @param string $offset * @throws UnsupportedProxyMethodException */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { throw new UnsupportedProxyMethodException('Unsetting a property of a path proxy not supported. (tried to unset: ' . $this->path . ' -- ' . $offset . ')', 1372667331); @@ -152,6 +156,7 @@ public function objectAccess() * * @return \ArrayIterator */ + #[\ReturnTypeWillChange] public function getIterator() { $evaluatedArray = []; @@ -172,6 +177,7 @@ public function getIterator() /** * @return integer */ + #[\ReturnTypeWillChange] public function count() { return count($this->partialFusionTree); diff --git a/Neos.Fusion/Classes/FusionObjects/Helpers/LazyProps.php b/Neos.Fusion/Classes/FusionObjects/Helpers/LazyProps.php index e295c7f2f41..c201a5965af 100644 --- a/Neos.Fusion/Classes/FusionObjects/Helpers/LazyProps.php +++ b/Neos.Fusion/Classes/FusionObjects/Helpers/LazyProps.php @@ -76,12 +76,12 @@ public function offsetGet($path): mixed public function offsetSet($path, $value): void { - throw new BadMethodCallException('Lazy props can not be set.', 1588182804); + throw new \BadMethodCallException('Lazy props can not be set.', 1588182804); } public function offsetUnset($path): void { - throw new BadMethodCallException('Lazy props can not be unset.', 1588182805); + throw new \BadMethodCallException('Lazy props can not be unset.', 1588182805); } public function current(): mixed diff --git a/Neos.Fusion/Classes/Service/DebugStack.php b/Neos.Fusion/Classes/Service/DebugStack.php index 49978d72911..9af28e686d5 100644 --- a/Neos.Fusion/Classes/Service/DebugStack.php +++ b/Neos.Fusion/Classes/Service/DebugStack.php @@ -40,6 +40,7 @@ public function dump() $this->flush(); $output = ''; foreach ($data as $debugMessage) { + /** @phpstan-ignore-next-line var_dump is not properly autoloadet */ $output .= \Neos\Flow\var_dump($debugMessage->getData(), $debugMessage->getTitle(), true, $debugMessage->isPlaintext()); } return $output; diff --git a/Neos.Media/Classes/Domain/Model/AssetSource/Neos/NeosAssetProxyQueryResult.php b/Neos.Media/Classes/Domain/Model/AssetSource/Neos/NeosAssetProxyQueryResult.php index 4aba929654c..fcadf0ee23e 100644 --- a/Neos.Media/Classes/Domain/Model/AssetSource/Neos/NeosAssetProxyQueryResult.php +++ b/Neos.Media/Classes/Domain/Model/AssetSource/Neos/NeosAssetProxyQueryResult.php @@ -17,6 +17,7 @@ use Neos\Flow\Annotations\Proxy; use Neos\Flow\Persistence\QueryResultInterface; use Neos\Media\Domain\Model\AssetInterface; +use ReturnTypeWillChange; /** * @Proxy(false) @@ -100,6 +101,7 @@ public function current(): ?AssetProxyInterface /** * @return void */ + #[ReturnTypeWillChange] public function next() { $this->flowPersistenceQueryResult->next(); @@ -108,6 +110,7 @@ public function next() /** * @return AssetProxyInterface|null */ + #[ReturnTypeWillChange] public function key() { return $this->flowPersistenceQueryResult->key(); @@ -116,6 +119,7 @@ public function key() /** * @return bool */ + #[ReturnTypeWillChange] public function valid() { return $this->flowPersistenceQueryResult->valid(); @@ -134,6 +138,7 @@ public function rewind() * @param mixed $offset * @return bool */ + #[ReturnTypeWillChange] public function offsetExists($offset) { return $this->flowPersistenceQueryResult->offsetExists($offset); @@ -143,6 +148,7 @@ public function offsetExists($offset) * @param mixed $offset * @return AssetProxyInterface|mixed */ + #[ReturnTypeWillChange] public function offsetGet($offset): ?AssetProxyInterface { return new NeosAssetProxy($this->flowPersistenceQueryResult->offsetGet($offset), $this->assetSource); @@ -152,6 +158,7 @@ public function offsetGet($offset): ?AssetProxyInterface * @param mixed $offset * @param mixed $value */ + #[ReturnTypeWillChange] public function offsetSet($offset, $value) { throw new \RuntimeException('Unsupported operation: ' . __METHOD__, 1510060444); @@ -160,6 +167,7 @@ public function offsetSet($offset, $value) /** * @param mixed $offset */ + #[ReturnTypeWillChange] public function offsetUnset($offset) { throw new \RuntimeException('Unsupported operation: ' . __METHOD__, 1510060467); diff --git a/Neos.Media/Classes/Domain/Service/AssetService.php b/Neos.Media/Classes/Domain/Service/AssetService.php index ae947d94d78..1a8035fdb5f 100644 --- a/Neos.Media/Classes/Domain/Service/AssetService.php +++ b/Neos.Media/Classes/Domain/Service/AssetService.php @@ -339,7 +339,7 @@ public function replaceAssetResource(AssetInterface $asset, PersistentResource $ } } - if ($redirectHandlerEnabled) { + if ($redirectHandlerEnabled && class_exists(RedirectStorageInterface::class)) { /** @var RedirectStorageInterface $redirectStorage */ $redirectStorage = $this->objectManager->get(RedirectStorageInterface::class); foreach ($uriMapping as $originalUri => $newUri) { diff --git a/Neos.Media/Classes/Imagine/Box.php b/Neos.Media/Classes/Imagine/Box.php index 712f150d0aa..154d0443741 100644 --- a/Neos.Media/Classes/Imagine/Box.php +++ b/Neos.Media/Classes/Imagine/Box.php @@ -15,6 +15,9 @@ use Imagine\Image\Point; use Imagine\Image\PointInterface; +/** + * @phpstan-consistent-constructor + */ class Box implements BoxInterface { /** diff --git a/Neos.Media/Classes/TypeConverter/ArrayConverter.php b/Neos.Media/Classes/TypeConverter/ArrayConverter.php index dbb3fc3b435..023be79d86f 100644 --- a/Neos.Media/Classes/TypeConverter/ArrayConverter.php +++ b/Neos.Media/Classes/TypeConverter/ArrayConverter.php @@ -151,5 +151,6 @@ public function convertFrom($source, $targetType, array $convertedChildPropertie 'assetCollections' => $convertedChildProperties['assetCollections'] ]; } + return null; } } diff --git a/Neos.Neos/Classes/Controller/Frontend/NodeController.php b/Neos.Neos/Classes/Controller/Frontend/NodeController.php index 168923fad04..d90a8e2b3e0 100644 --- a/Neos.Neos/Classes/Controller/Frontend/NodeController.php +++ b/Neos.Neos/Classes/Controller/Frontend/NodeController.php @@ -95,7 +95,7 @@ protected function initializeShowAction(): void * account. * * @param NodeInterface $node - * @return string View output for the specified node + * @return void View output for the specified node * @throws NodeNotFoundException | UnresolvableShortcutException | NeosException * We need to skip CSRF protection here because this action could be called with unsafe requests from widgets or plugins that are rendered on the node - For those the CSRF token is validated on the sub-request, so it is safe to be skipped here * @Flow\SkipCsrfProtection @@ -131,7 +131,7 @@ protected function initializePreviewAction(): void * Previews a node that is not live (i.e. for the Backend Preview & Edit Mode) * * @param NodeInterface $node - * @return string View output for the specified node + * @return void View output for the specified node * @throws NeosException | NodeNotFoundException | SessionNotStartedException | UnresolvableShortcutException * @Flow\IgnoreValidation("node") */ diff --git a/Neos.Neos/Classes/Controller/Service/AssetsController.php b/Neos.Neos/Classes/Controller/Service/AssetsController.php index 5a293472103..0b6ed1890b1 100644 --- a/Neos.Neos/Classes/Controller/Service/AssetsController.php +++ b/Neos.Neos/Classes/Controller/Service/AssetsController.php @@ -81,7 +81,7 @@ public function initializeView(ViewInterface $view) * Shows a list of assets * * @param string $searchTerm An optional search term used for filtering the list of assets - * @return string + * @return void */ public function indexAction($searchTerm = '') { @@ -97,7 +97,7 @@ public function indexAction($searchTerm = '') * Shows a specific asset * * @param string $identifier Specifies the asset to look up - * @return string + * @return void * @throws StopActionException * @throws UnsupportedRequestTypeException */ diff --git a/Neos.Neos/Classes/Controller/Service/NodesController.php b/Neos.Neos/Classes/Controller/Service/NodesController.php index 2722382ce21..65dbaf309d4 100644 --- a/Neos.Neos/Classes/Controller/Service/NodesController.php +++ b/Neos.Neos/Classes/Controller/Service/NodesController.php @@ -89,7 +89,7 @@ class NodesController extends ActionController * @param array $dimensions Optional list of dimensions and their values which should be used for querying * @param array $nodeTypes A list of node types the list should be filtered by * @param NodeInterface $contextNode a node to use as context for the search - * @return string + * @return void */ public function indexAction($searchTerm = '', array $nodeIdentifiers = [], $workspaceName = 'live', array $dimensions = [], array $nodeTypes = ['Neos.Neos:Document'], NodeInterface $contextNode = null) { @@ -126,7 +126,7 @@ public function indexAction($searchTerm = '', array $nodeIdentifiers = [], $work * @param string $identifier Specifies the node to look up * @param string $workspaceName Name of the workspace to use for querying the node * @param array $dimensions Optional list of dimensions and their values which should be used for querying the specified node - * @return string + * @return void */ public function showAction($identifier, $workspaceName = 'live', array $dimensions = []) { @@ -166,7 +166,7 @@ public function showAction($identifier, $workspaceName = 'live', array $dimensio * @param string $workspaceName Name of the workspace where to create the node in * @param array $dimensions Optional list of dimensions and their values in which the node should be created * @param array $sourceDimensions - * @return string + * @return void */ public function createAction($mode, $identifier, $workspaceName = 'live', array $dimensions = [], array $sourceDimensions = []) { diff --git a/Neos.Neos/Classes/Controller/Service/WorkspacesController.php b/Neos.Neos/Classes/Controller/Service/WorkspacesController.php index 614115dd08b..50020be6a46 100644 --- a/Neos.Neos/Classes/Controller/Service/WorkspacesController.php +++ b/Neos.Neos/Classes/Controller/Service/WorkspacesController.php @@ -60,7 +60,7 @@ class WorkspacesController extends ActionController /** * Shows a list of existing workspaces * - * @return string + * @return void */ public function indexAction() { @@ -92,7 +92,7 @@ public function indexAction() * Shows details of the given workspace * * @param Workspace $workspace - * @return string + * @return void */ public function showAction(Workspace $workspace) { diff --git a/Neos.Neos/Classes/Domain/Model/UserInterfaceMode.php b/Neos.Neos/Classes/Domain/Model/UserInterfaceMode.php index 36ac5407919..83cd1d5d39c 100644 --- a/Neos.Neos/Classes/Domain/Model/UserInterfaceMode.php +++ b/Neos.Neos/Classes/Domain/Model/UserInterfaceMode.php @@ -168,6 +168,7 @@ public function setOptions($options) */ public static function createByConfiguration($modeName, array $configuration) { + /** @phpstan-ignore-next-line */ $mode = new static(); $mode->setName($modeName); $mode->setPreview($configuration['isPreviewMode']); diff --git a/Neos.Neos/Classes/Service/Controller/DataSourceController.php b/Neos.Neos/Classes/Service/Controller/DataSourceController.php index 46ca03df2cf..ee7d77c2212 100644 --- a/Neos.Neos/Classes/Service/Controller/DataSourceController.php +++ b/Neos.Neos/Classes/Service/Controller/DataSourceController.php @@ -37,7 +37,7 @@ class DataSourceController extends AbstractServiceController /** * @param string $dataSourceIdentifier * @param NodeInterface $node - * @return string + * @return void * @throws NeosException */ public function indexAction($dataSourceIdentifier, NodeInterface $node = null) diff --git a/Neos.Neos/Classes/Service/Controller/NodeController.php b/Neos.Neos/Classes/Service/Controller/NodeController.php index 665d97a6485..47010bb974a 100644 --- a/Neos.Neos/Classes/Service/Controller/NodeController.php +++ b/Neos.Neos/Classes/Service/Controller/NodeController.php @@ -200,7 +200,7 @@ public function createAction(Node $referenceNode, array $nodeData, $position) * @param string $fusionPath The Fusion path of the collection * @param array $nodeData * @param string $position where the node should be added (allowed: before, into, after) - * @return string + * @return void */ public function createAndRenderAction(Node $referenceNode, $fusionPath, array $nodeData, $position) { @@ -391,7 +391,7 @@ public function deleteAction(Node $node) * * @param NodeInterface $node * @param string $fusionPath - * @return string + * @return void */ protected function redirectToRenderNode(NodeInterface $node, $fusionPath) { diff --git a/Neos.Neos/Classes/ViewHelpers/Backend/UserInitialsViewHelper.php b/Neos.Neos/Classes/ViewHelpers/Backend/UserInitialsViewHelper.php index 6c0feffe594..0da4bcc1da3 100644 --- a/Neos.Neos/Classes/ViewHelpers/Backend/UserInitialsViewHelper.php +++ b/Neos.Neos/Classes/ViewHelpers/Backend/UserInitialsViewHelper.php @@ -57,15 +57,10 @@ public function initializeArguments() /** * Render user initials or an abbreviated name for a given username. If the account was deleted, use the username as fallback. * - * @return string * @throws \Neos\Neos\Domain\Exception */ public function render(): string { - if (!in_array($this->arguments['format'], ['fullFirstName', 'initials', 'fullName'])) { - throw new \InvalidArgumentException(sprintf('Format "%s" given to backend.userInitials(), only supporting "fullFirstName", "initials" and "fullName".', $format), 1415705861); - } - $username = (string)$this->renderChildren(); /* @var $requestedUser Person */ @@ -88,5 +83,7 @@ public function render(): string case 'fullName': return $you ?? $requestedUser->getName()->getFullName(); } + + throw new \InvalidArgumentException(sprintf('Format "%s" given to backend.userInitials(), only supporting "fullFirstName", "initials" and "fullName".', $this->arguments['format']), 1415705861); } } diff --git a/Neos.SiteKickstarter/Classes/Command/KickstartCommandController.php b/Neos.SiteKickstarter/Classes/Command/KickstartCommandController.php index 6c7eb07740b..a294af48583 100755 --- a/Neos.SiteKickstarter/Classes/Command/KickstartCommandController.php +++ b/Neos.SiteKickstarter/Classes/Command/KickstartCommandController.php @@ -48,7 +48,6 @@ class KickstartCommandController extends CommandController * * @param string $packageKey The packageKey for your site * @param string $siteName The siteName of your site - * @return string */ public function siteCommand($packageKey, $siteName) { diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 00000000000..a3d2134c686 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,19 @@ +parameters: + level: 0 + ignoreErrors: + # Errors caused by the backport of the ESCR TraversableNodeInterface + - '#has invalid return type Neos\\ContentRepository\\DimensionSpace\\DimensionSpace\\DimensionSpacePoint.$#' + - '#has invalid return type Neos\\EventSourcedContentRepository\\Domain\\Context\\NodeAggregate\\OriginDimensionSpacePoint.$#' + - '#has invalid type Neos\\EventSourcedContentRepository\\Domain\\ValueObject\\PropertyName.$#' + paths: + - Neos.ContentRepository/Classes + - Neos.Diff/Classes + - Neos.Fusion.Afx/Classes + - Neos.Fusion/Classes + - Neos.Media.Browser/Classes + - Neos.Media/Classes + - Neos.Neos/Classes + - Neos.NodeTypes.Form/Classes + - Neos.SiteKickstarter/Classes + bootstrapFiles: + - ../Framework/bootstrap-phpstan.php From 885158b8b0cb341204543659463ff95697e51a22 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 18 Jan 2024 21:29:59 +0100 Subject: [PATCH 3/4] TASK: Run php-stan on ci in Neos 8.3 --- .composer.json | 6 ++++++ .github/workflows/build.yml | 32 ++++++++++---------------------- composer.json | 6 ++++++ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.composer.json b/.composer.json index ba985efacae..48a46ea6ceb 100644 --- a/.composer.json +++ b/.composer.json @@ -6,6 +6,12 @@ "require": { "neos/flow-development-collection": "8.3.x-dev" }, + "scripts": { + "lint:phpstan": "../../bin/phpstan analyse", + "lint": [ + "@lint:phpstan" + ] + }, "replace": { }, "suggest": { diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b37ada09b7e..735d6580ac7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: contents: read # to fetch code (actions/checkout) if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip travis]')" - name: "PHP ${{ matrix.php-versions }} Test ${{ matrix.static-analysis != 'no' && matrix.static-analysis || '' }} (deps: ${{ matrix.dependencies }})" + name: "PHP ${{ matrix.php-versions }} Test ${{ matrix.static-analysis != 'no' && 'static analysis ' || '' }} (deps: ${{ matrix.dependencies }})" continue-on-error: ${{ matrix.experimental }} @@ -26,24 +26,11 @@ jobs: composer-arguments: [''] # to run --ignore-platform-reqs in experimental builds static-analysis: ['no'] experimental: [false] - #include: - #- php-versions: '7.3' - # static-analysis: 'psalm' - # experimental: false - # dependencies: 'highest' - - # Experimental build for PHP nightly - #- php-versions: 'nightly' - # composer-arguments: '--ignore-platform-reqs' - # static-analysis: 'no' - # experimental: true - # dependencies: 'highest' - - # Build for minimum dependencies. Fails right now, hence deactivated. - #- php-versions: '7.1' - # static-analysis: 'no' - # experimental: false - # dependencies: 'lowest' + include: + - php-versions: '8.1' + static-analysis: 'yes' + experimental: false + dependencies: 'highest' runs-on: ubuntu-latest services: @@ -142,6 +129,7 @@ jobs: run: echo "FLOW_CONTEXT=${{ env.FLOW_CONTEXT }}" >> $GITHUB_ENV - name: Setup Flow configuration + if: matrix.static-analysis == 'no' run: | rm -f Configuration/Routes.yaml rm -f Configuration/Testing/Settings.yaml @@ -163,9 +151,9 @@ jobs: ./flow configuration:show ./flow routing:list - #- name: Static analysis - # if: matrix.static-analysis == 'psalm' - # run: composer test-static + - name: Static analysis + if: matrix.static-analysis == 'yes' + run: cd Packages/Neos && composer lint:phpstan - name: Run unit tests if: matrix.static-analysis == 'no' diff --git a/composer.json b/composer.json index 558b54635df..cf827eb47f4 100644 --- a/composer.json +++ b/composer.json @@ -34,6 +34,12 @@ "neos/form": "*", "neos/kickstarter": "~8.3.0" }, + "scripts": { + "lint:phpstan": "../../bin/phpstan analyse", + "lint": [ + "@lint:phpstan" + ] + }, "replace": { "typo3/typo3cr": "self.version", "packagefactory/atomicfusion-afx": "*", From 6b338b444cb71d99db54d63c3737cf8a7afd52ce Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 18 Jan 2024 22:12:44 +0100 Subject: [PATCH 4/4] TASK: Add php-stan level 1 to 8.3 codebase --- .../Classes/Domain/Model/Node.php | 1 + .../Domain/NodeType/NodeTypeConstraintFactory.php | 2 +- .../Domain/Repository/NodeDataRepository.php | 4 ++-- Neos.Diff/Classes/SequenceMatcher.php | 2 +- .../Core/ExceptionHandlers/PlainTextHandler.php | 2 +- .../Core/ExceptionHandlers/XmlCommentHandler.php | 2 +- .../Core/ObjectTreeParser/FilePatternResolver.php | 1 + Neos.Fusion/Classes/Core/RuntimeConfiguration.php | 2 ++ Neos.Fusion/Classes/Service/DebugStack.php | 2 +- .../Classes/Controller/AssetController.php | 2 +- .../Neos/NeosAssetProxyQueryResult.php | 15 +++++++-------- .../NodeTypeConfigurationEnrichmentAspect.php | 8 ++++---- .../Controller/Backend/ModuleController.php | 2 +- .../Domain/Repository/DomainRepository.php | 2 ++ .../Classes/Domain/Repository/SiteRepository.php | 1 + .../Controller/AbstractServiceController.php | 1 + .../Backend/IfModuleAccessibleViewHelper.php | 1 + phpstan.neon.dist | 2 +- 18 files changed, 30 insertions(+), 22 deletions(-) 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.$#'