diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd9dbc9dc1..80a4de9230 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -120,8 +120,6 @@ jobs: git -C ../${{ env.FLOW_FOLDER }} checkout -b build composer config repositories.flow '{ "type": "path", "url": "../${{ env.FLOW_FOLDER }}", "options": { "symlink": false } }' composer require --no-update neos/flow-development-collection:"dev-build as ${{ env.FLOW_BRANCH_ALIAS }}" - # todo remove temporary hack ;) (sorry - if i forget) - composer require --no-update --dev "phpstan/phpstan:^1.10.0" - name: Cache Composer packages id: composer-cache diff --git a/Neos.Eel/Classes/CompilingEvaluator.php b/Neos.Eel/Classes/CompilingEvaluator.php index 06cf4c18a9..f2d8200285 100644 --- a/Neos.Eel/Classes/CompilingEvaluator.php +++ b/Neos.Eel/Classes/CompilingEvaluator.php @@ -97,15 +97,15 @@ protected function evaluateAndUnwrap(\closure $expressionFunction, Context $cont */ protected function generateEvaluatorCode($expression) { - /** @phpstan-ignore-next-line */ + /** @phpstan-ignore-next-line `CompilingEelParser` has been explicitly excluded from analysis, because it contains generated code that is impossible to fix */ $parser = new CompilingEelParser($expression); $result = $parser->match_Expression(); if ($result === false) { throw new ParserException(sprintf('Expression "%s" could not be parsed.', $expression), 1344513194); - /** @phpstan-ignore-next-line */ + /** @phpstan-ignore-next-line $parser->pos appears to be undeclared, because instantiation of $parser is hidden as well */ } elseif ($parser->pos !== strlen($expression)) { - /** @phpstan-ignore-next-line */ + /** @phpstan-ignore-next-line $parser->pos appears to be undeclared, because instantiation of $parser is hidden as well */ throw new ParserException(sprintf('Expression "%s" could not be parsed. Error starting at character %d: "%s".', $expression, $parser->pos, substr($expression, $parser->pos)), 1327682383); } elseif (!array_key_exists('code', $result)) { throw new ParserException(sprintf('Parser error, no code in result %s ', json_encode($result)), 1334491498); diff --git a/Neos.Eel/Classes/InterpretedEvaluator.php b/Neos.Eel/Classes/InterpretedEvaluator.php index 1f653e6ebc..b113e065b1 100644 --- a/Neos.Eel/Classes/InterpretedEvaluator.php +++ b/Neos.Eel/Classes/InterpretedEvaluator.php @@ -35,9 +35,12 @@ public function evaluate($expression, Context $context) if ($res === false) { throw new ParserException(sprintf('Expression "%s" could not be parsed.', $expression), 1344514198); - /** @phpstan-ignore-next-line */ + /** + * @phpstan-ignore-next-line $parser->pos appears to be undeclared, because it is declared up in the parent class chain of `InterpretedEelParser`, + * wherein multiple classes (e.g. `EelParser` and `AbstractEelParser`) are explicitly excluded from analysis, because they contain generated code that is impossible to fix + */ } elseif ($parser->pos !== strlen($expression)) { - /** @phpstan-ignore-next-line */ + /** @phpstan-ignore-next-line $parser->pos appears to be undeclared see comment above. */ throw new ParserException(sprintf('Expression "%s" could not be parsed. Error starting at character %d: "%s".', $expression, $parser->pos, substr($expression, $parser->pos)), 1344514188); } elseif (!array_key_exists('val', $res)) { throw new ParserException(sprintf('Parser error, no val in result %s ', json_encode($res)), 1344514204); diff --git a/Neos.Flow/Classes/Aop/Advice/AdviceChain.php b/Neos.Flow/Classes/Aop/Advice/AdviceChain.php index 2312a8106d..21da910d4b 100644 --- a/Neos.Flow/Classes/Aop/Advice/AdviceChain.php +++ b/Neos.Flow/Classes/Aop/Advice/AdviceChain.php @@ -11,7 +11,7 @@ * source code. */ use Neos\Flow\Aop\JoinPointInterface; -use Neos\Flow\Aop\ProxyInterface; +use Neos\Flow\Aop\ProxyInterface as InternalAopProxyInterface; /** * The advice chain holds a number of subsequent advices that @@ -57,7 +57,7 @@ public function proceed(JoinPointInterface &$joinPoint) if ($this->adviceIndex < count($this->advices)) { $result = $this->advices[$this->adviceIndex]->invoke($joinPoint); } else { - /** @var ProxyInterface $proxy */ + /** @var InternalAopProxyInterface $proxy */ $proxy = $joinPoint->getProxy(); $result = $proxy->Flow_Aop_Proxy_invokeJoinpoint($joinPoint); } diff --git a/Neos.Flow/Classes/Cli/Response.php b/Neos.Flow/Classes/Cli/Response.php index 5e44675549..0fedb619d0 100644 --- a/Neos.Flow/Classes/Cli/Response.php +++ b/Neos.Flow/Classes/Cli/Response.php @@ -47,7 +47,7 @@ class Response private $content = ''; /** - * @var boolean|int + * @var bool|int */ private $colorSupport; @@ -118,7 +118,6 @@ public function getContent(): string /** * Sets color support / styled output to yes, no or auto detection * - * @deprecated and will be removed https://github.com/neos/flow-development-collection/pull/3262 * @param boolean $colorSupport true, false or NULL (= autodetection) * @return void */ diff --git a/Neos.Flow/Classes/Command/ResourceCommandController.php b/Neos.Flow/Classes/Command/ResourceCommandController.php index 156cf3e227..dcb2ec7b95 100644 --- a/Neos.Flow/Classes/Command/ResourceCommandController.php +++ b/Neos.Flow/Classes/Command/ResourceCommandController.php @@ -24,7 +24,6 @@ use Neos\Flow\ResourceManagement\ResourceManager; use Neos\Flow\ResourceManagement\ResourceRepository; use Neos\Media\Domain\Repository\AssetRepository; - use Neos\Media\Domain\Repository\ThumbnailRepository; /** @@ -239,7 +238,7 @@ public function cleanCommand() foreach ($brokenResources as $key => $resourceIdentifier) { $resource = $this->resourceRepository->findByIdentifier($resourceIdentifier); $brokenResources[$key] = $resource; - if ($mediaPackagePresent && class_exists(AssetRepository::class) && class_exists(ThumbnailRepository::class)) { + if ($mediaPackagePresent && $assetRepository !== null && $thumbnailRepository !== null) { $assets = $assetRepository->findByResource($resource); if ($assets !== null) { $relatedAssets[$resource] = $assets; @@ -281,7 +280,7 @@ public function cleanCommand() ]); $resource->disableLifecycleEvents(); $this->resourceRepository->remove($resource); - if ($mediaPackagePresent && class_exists(AssetRepository::class) && class_exists(ThumbnailRepository::class)) { + if ($mediaPackagePresent && $assetRepository !== null && $thumbnailRepository !== null) { if (isset($relatedAssets[$resource])) { foreach ($relatedAssets[$resource] as $asset) { $assetRepository->removeWithoutUsageChecks($asset); diff --git a/Neos.Flow/Classes/Log/ThrowableStorage/FileStorage.php b/Neos.Flow/Classes/Log/ThrowableStorage/FileStorage.php index 347978897b..c20b65b99c 100644 --- a/Neos.Flow/Classes/Log/ThrowableStorage/FileStorage.php +++ b/Neos.Flow/Classes/Log/ThrowableStorage/FileStorage.php @@ -267,7 +267,6 @@ protected function cleanupThrowableDumps(): void $cutoffTime = time() - $this->maximumThrowableDumpAge; $iterator = new \DirectoryIterator($this->storagePath); - /** @var \DirectoryIterator $directoryEntry */ foreach ($iterator as $directoryEntry) { if ($directoryEntry->isFile() && $directoryEntry->getCTime() < $cutoffTime) { unlink($directoryEntry->getRealPath()); diff --git a/Neos.FluidAdaptor/Classes/Core/Cache/CacheAdaptor.php b/Neos.FluidAdaptor/Classes/Core/Cache/CacheAdaptor.php index f7272f0da3..43bb16e5a4 100644 --- a/Neos.FluidAdaptor/Classes/Core/Cache/CacheAdaptor.php +++ b/Neos.FluidAdaptor/Classes/Core/Cache/CacheAdaptor.php @@ -61,7 +61,7 @@ public function set($name, $value) * the entire cache if no entry is provided. * * @param string|null $name - * @return bool|void + * @return bool|null */ public function flush($name = null) { @@ -69,6 +69,7 @@ public function flush($name = null) return $this->flowCache->remove($name); } else { $this->flowCache->flush(); + return null; } } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 1c75e8a6cb..2d8a0153ee 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -26,6 +26,7 @@ parameters: excludePaths: analyse: - Neos.Flow/.phpstorm.meta.php + # The parsers are autogenerated / extending autogenerated code and not analysable - Neos.Eel/Classes/FlowQuery/FizzleParser.php - Neos.Eel/Classes/AbstractParser.php - Neos.Eel/Classes/EelParser.php