mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-02 17:30:50 +00:00
67f4bcd4f3
0b5d2ed239
Make init part of process command to help new users with creating config (#3326)
36 lines
1.0 KiB
PHP
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;
|
|
}
|
|
}
|