diff --git a/phpstan.neon b/phpstan.neon index 4c6f4c9b873..308329d0056 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -554,7 +554,6 @@ parameters: paths: - packages/BetterPhpDocParser/ValueObject/PhpDoc/DoctrineAnnotation/AbstractValuesAwareNode.php - rules/Strict/Rector/AbstractFalsyScalarRuleFixerRector.php - - src/Console/Command/AbstractProcessCommand.php - src/Rector/AbstractRector.php # useless diff --git a/src/Console/Command/AbstractProcessCommand.php b/src/Console/Command/AbstractProcessCommand.php index 58494fc0b3f..392ec9d4d6a 100644 --- a/src/Console/Command/AbstractProcessCommand.php +++ b/src/Console/Command/AbstractProcessCommand.php @@ -5,23 +5,13 @@ namespace Rector\Core\Console\Command; use Rector\ChangesReporting\Output\ConsoleOutputFormatter; -use Rector\Core\Configuration\ConfigurationFactory; use Rector\Core\Configuration\Option; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; -use Symfony\Contracts\Service\Attribute\Required; abstract class AbstractProcessCommand extends Command { - protected ConfigurationFactory $configurationFactory; - - #[Required] - public function autowire(ConfigurationFactory $configurationFactory): void - { - $this->configurationFactory = $configurationFactory; - } - protected function configure(): void { $this->addArgument( diff --git a/src/Console/Command/ProcessCommand.php b/src/Console/Command/ProcessCommand.php index b5cbc7bf715..aa948b9c10a 100644 --- a/src/Console/Command/ProcessCommand.php +++ b/src/Console/Command/ProcessCommand.php @@ -9,6 +9,7 @@ use Rector\Core\Application\ApplicationFileProcessor; use Rector\Core\Autoloading\AdditionalAutoloader; use Rector\Core\Configuration\ConfigInitializer; +use Rector\Core\Configuration\ConfigurationFactory; use Rector\Core\Configuration\Option; use Rector\Core\Console\ExitCode; use Rector\Core\Console\Output\OutputFormatterCollector; @@ -35,6 +36,7 @@ public function __construct( private readonly OutputFormatterCollector $outputFormatterCollector, private readonly SymfonyStyle $symfonyStyle, private readonly MemoryLimiter $memoryLimiter, + private readonly ConfigurationFactory $configurationFactory ) { parent::__construct(); } diff --git a/src/Console/Command/WorkerCommand.php b/src/Console/Command/WorkerCommand.php index 6bb2c7f1661..c236ff7acff 100644 --- a/src/Console/Command/WorkerCommand.php +++ b/src/Console/Command/WorkerCommand.php @@ -9,6 +9,7 @@ use React\EventLoop\StreamSelectLoop; use React\Socket\ConnectionInterface; use React\Socket\TcpConnector; +use Rector\Core\Configuration\ConfigurationFactory; use Rector\Core\Util\MemoryLimiter; use Rector\Parallel\WorkerRunner; use Symfony\Component\Console\Input\InputInterface; @@ -28,6 +29,7 @@ final class WorkerCommand extends AbstractProcessCommand public function __construct( private readonly WorkerRunner $workerRunner, private readonly MemoryLimiter $memoryLimiter, + private readonly ConfigurationFactory $configurationFactory ) { parent::__construct(); }