diff --git a/rector.php b/rector.php index f39a47bad..8da2fc2be 100644 --- a/rector.php +++ b/rector.php @@ -9,6 +9,7 @@ use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector; use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector; use Rector\Php71\Rector\FuncCall\CountOnNullRector; +use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; @@ -47,6 +48,9 @@ __DIR__ . '/src/Prototype/src/NodeVisitors/RemoveTrait.php', __DIR__ . '/src/Logger/src/ListenerRegistry.php', ], + RemoveExtraParametersRector::class => [ + __DIR__ . '/src/Boot/src/BootloadManager/AbstractBootloadManager.php', + ], ]); $config->import(LevelSetList::UP_TO_PHP_72); diff --git a/src/AnnotatedRoutes/src/RouteLocatorListener.php b/src/AnnotatedRoutes/src/RouteLocatorListener.php index 4c649dc7a..e6ee46bc7 100644 --- a/src/AnnotatedRoutes/src/RouteLocatorListener.php +++ b/src/AnnotatedRoutes/src/RouteLocatorListener.php @@ -58,7 +58,6 @@ public function finalize(): void ]; } - /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ \uasort($routes, static fn (array $route1, array $route2) => $route1['priority'] <=> $route2['priority']); $this->configureRoutes($routes); diff --git a/src/Core/src/Internal/Factory.php b/src/Core/src/Internal/Factory.php index 30ff72632..de56bbe53 100644 --- a/src/Core/src/Internal/Factory.php +++ b/src/Core/src/Internal/Factory.php @@ -321,7 +321,6 @@ private function resolveWithoutBinding(string $alias, array $parameters = [], st */ private function autowire(Ctx $ctx, array $arguments): object { - /** @psalm-suppress NoValue, InvalidArrayOffset */ if (!(\class_exists($ctx->class) || ( \interface_exists($ctx->class) && diff --git a/src/Framework/Bootloader/Debug/LogCollectorBootloader.php b/src/Framework/Bootloader/Debug/LogCollectorBootloader.php index 4b51b3283..f5e9698aa 100644 --- a/src/Framework/Bootloader/Debug/LogCollectorBootloader.php +++ b/src/Framework/Bootloader/Debug/LogCollectorBootloader.php @@ -27,6 +27,9 @@ public function init( ): void { $listenerRegistry->addListener($logCollector); + /** + * @psalm-suppress InvalidArgument + */ $debug->addStateCollector($logCollector); $finalizer->addFinalizer([$logCollector, 'reset']); } diff --git a/src/Framework/Console/Logger/DebugListener.php b/src/Framework/Console/Logger/DebugListener.php index 46686b85f..77dd7f673 100644 --- a/src/Framework/Console/Logger/DebugListener.php +++ b/src/Framework/Console/Logger/DebugListener.php @@ -69,6 +69,7 @@ public function withOutput(OutputInterface $output): self /** * Enable logging in console mode. + * @psalm-suppress InvalidReturnType, InvalidReturnStatement */ public function enable(): self { @@ -81,6 +82,7 @@ public function enable(): self /** * Disable displaying logs in console. + * @psalm-suppress InvalidReturnType, InvalidReturnStatement */ public function disable(): self { diff --git a/src/Session/src/Handler/FileHandler.php b/src/Session/src/Handler/FileHandler.php index 71418a7c2..51dd1d13f 100644 --- a/src/Session/src/Handler/FileHandler.php +++ b/src/Session/src/Handler/FileHandler.php @@ -32,6 +32,7 @@ public function destroy(string $id): bool /** * @codeCoverageIgnore + * @psalm-suppress ParamNameMismatch */ public function gc(int $maxlifetime): int { @@ -44,6 +45,9 @@ public function gc(int $maxlifetime): int return $maxlifetime; } + /** + * @psalm-suppress ParamNameMismatch + */ public function open(string $path, string $id): bool { return true; diff --git a/src/Session/src/Handler/NullHandler.php b/src/Session/src/Handler/NullHandler.php index c1af4ca4b..01fa53c34 100644 --- a/src/Session/src/Handler/NullHandler.php +++ b/src/Session/src/Handler/NullHandler.php @@ -19,11 +19,17 @@ public function destroy(string $id): bool return true; } + /** + * @psalm-suppress ParamNameMismatch + */ public function gc(int $maxlifetime): int { return $maxlifetime; } + /** + * @psalm-suppress ParamNameMismatch + */ public function open(string $path, string $id): bool { return true; diff --git a/src/Stempler/src/helpers.php b/src/Stempler/src/helpers.php index 4dd22b8dc..93fa513d6 100644 --- a/src/Stempler/src/helpers.php +++ b/src/Stempler/src/helpers.php @@ -5,8 +5,6 @@ if (!\function_exists('inject')) { /** * Macro function to be replaced by the injected value. - * - * @psalm-suppress UnusedParam */ function inject(string $name, mixed $default = null): mixed { diff --git a/src/Tokenizer/src/Attribute/TargetAttribute.php b/src/Tokenizer/src/Attribute/TargetAttribute.php index 6020f2126..60c37121e 100644 --- a/src/Tokenizer/src/Attribute/TargetAttribute.php +++ b/src/Tokenizer/src/Attribute/TargetAttribute.php @@ -37,6 +37,7 @@ public function filter(array $classes): \Generator // If annotations are used, we need to use the annotation reader also // It will slow down the process a bit, but it will allow us to use annotations + /** @psalm-suppress InternalClass */ $reader = $this->useAnnotations ? (new Factory())->create() : new AttributeReader($this->namedArguments ? new NamedArgumentsInstantiator() : null);