From 25df75b658784848bcd747d67e397ac7719266e1 Mon Sep 17 00:00:00 2001 From: kaizen-ci Date: Mon, 17 May 2021 23:14:28 +0000 Subject: [PATCH] [ci-review] Rector Rectify --- src/Console/Command/ShowCommand.php | 2 +- .../CompilerPass/DeprecationWarningCompilerPass.php | 7 ++++--- src/NodeManipulator/ClassMethodAssignManipulator.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Console/Command/ShowCommand.php b/src/Console/Command/ShowCommand.php index b30f0426074..561b983febb 100644 --- a/src/Console/Command/ShowCommand.php +++ b/src/Console/Command/ShowCommand.php @@ -38,7 +38,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int private function reportLoadedRectors(): void { - $rectors = array_filter($this->rectors, function (RectorInterface $rector) { + $rectors = array_filter($this->rectors, function (RectorInterface $rector): bool { return ! $rector instanceof PostRectorInterface; }); diff --git a/src/DependencyInjection/CompilerPass/DeprecationWarningCompilerPass.php b/src/DependencyInjection/CompilerPass/DeprecationWarningCompilerPass.php index 40b7546ddfa..002fc878cdd 100644 --- a/src/DependencyInjection/CompilerPass/DeprecationWarningCompilerPass.php +++ b/src/DependencyInjection/CompilerPass/DeprecationWarningCompilerPass.php @@ -19,14 +19,15 @@ final class DeprecationWarningCompilerPass implements CompilerPassInterface public function process(ContainerBuilder $containerBuilder): void { - $parametersBag = $containerBuilder->getParameterBag(); + $parameterBag = $containerBuilder->getParameterBag(); foreach (self::DEPRECATED_PARAMETERS as $parameter => $message) { - if (! $parametersBag->has($parameter)) { + $parameterBagHas = $parameterBag->has($parameter); + if (! $parameterBagHas) { continue; } - $setsParameters = $parametersBag->get($parameter); + $setsParameters = $parameterBag->get($parameter); if ($setsParameters === []) { continue; } diff --git a/src/NodeManipulator/ClassMethodAssignManipulator.php b/src/NodeManipulator/ClassMethodAssignManipulator.php index c06661bbb6d..869b133014b 100644 --- a/src/NodeManipulator/ClassMethodAssignManipulator.php +++ b/src/NodeManipulator/ClassMethodAssignManipulator.php @@ -36,7 +36,7 @@ final class ClassMethodAssignManipulator /** * @var array */ - private $alreadyAddedClassMethodNames = []; + private array $alreadyAddedClassMethodNames = []; public function __construct( private BetterNodeFinder $betterNodeFinder,