Init command feature (#4329)

* add init command

* update as per CI review

* update as per CI review 2

* update as per CI review 3

* update as per testing command

* update as per CI review
This commit is contained in:
Kerrial Newham 2020-09-29 17:46:21 +02:00 committed by GitHub
parent 4578e6d849
commit f67369735a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View File

@ -2,13 +2,8 @@
declare(strict_types=1);
use Rector\Architecture\Rector\Class_\MoveRepositoryFromParentToConstructorRector;
use Rector\Architecture\Rector\MethodCall\ReplaceParentRepositoryCallsByRepositoryPropertyRector;
use Rector\Core\Configuration\Option;
use Rector\Doctrine\Rector\Class_\RemoveRepositoryFromEntityAnnotationRector;
use Rector\Set\ValueObject\SetList;
use Rector\SOLID\Rector\Class_\FinalizeClassesWithoutChildrenRector;
use Rector\TypeDeclaration\Rector\Property\PropertyTypeDeclarationRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {

View File

@ -45,7 +45,7 @@ final class InitCommand extends AbstractCommand
$rectorConfigFiles = $this->smartFileSystem->exists(getcwd() . '/rector.php');
if (! $rectorConfigFiles) {
$this->smartFileSystem->copy('rector.php.dist', getcwd() . '/rector.php');
$this->smartFileSystem->copy(__DIR__ . '/../../../rector.php.dist', getcwd() . '/rector.php');
$this->symfonyStyle->success('rector.php config file has been generated successfully');
} else {
$this->symfonyStyle->error('Config file not generated. A rector.php configuration file already exists');