Skip to content

Commit

Permalink
[Console] Remove #[Required] on AbstractProcessCommand (#4713)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Aug 8, 2023
1 parent 6e9378e commit 211deb4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions src/Console/Command/AbstractProcessCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions src/Console/Command/ProcessCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
Expand Down
2 changes: 2 additions & 0 deletions src/Console/Command/WorkerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
Expand Down

0 comments on commit 211deb4

Please sign in to comment.