rector/src/Console/Command/InitCommand.php
Tomas Votruba 67f4bcd4f3 Updated Rector to commit 0b5d2ed239b45cddcf4597eac75e23bad1e90cbf
0b5d2ed239 Make init part of process command to help new users with creating config (#3326)
2023-01-30 15:32:02 +00:00

36 lines
1.0 KiB
PHP

<?php
declare (strict_types=1);
namespace Rector\Core\Console\Command;
use Rector\Core\Configuration\ConfigInitializer;
use RectorPrefix202301\Symfony\Component\Console\Command\Command;
use RectorPrefix202301\Symfony\Component\Console\Input\InputInterface;
use RectorPrefix202301\Symfony\Component\Console\Output\OutputInterface;
/**
* @deprecated Now part of the "process" command
*/
final class InitCommand extends Command
{
/**
* @readonly
* @var \Rector\Core\Configuration\ConfigInitializer
*/
private $configInitializer;
public function __construct(ConfigInitializer $configInitializer)
{
$this->configInitializer = $configInitializer;
parent::__construct();
}
protected function configure() : void
{
$this->setName('init');
$this->setDescription('Generate rector.php configuration file');
}
protected function execute(InputInterface $input, OutputInterface $output) : int
{
$this->configInitializer->createConfig(\getcwd());
return Command::SUCCESS;
}
}