|
|
@@ -2,30 +2,24 @@
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
-use Rector\Core\Configuration\Option;
|
|
|
-use Rector\Core\ValueObject\PhpVersion;
|
|
|
-use Rector\Doctrine\Set\DoctrineSetList;
|
|
|
-use Rector\Php74\Rector\Property\TypedPropertyRector;
|
|
|
-use Rector\Set\ValueObject\LevelSetList;
|
|
|
-use Rector\Symfony\Set\SensiolabsSetList;
|
|
|
-use Rector\Symfony\Set\SymfonyLevelSetList;
|
|
|
-use Rector\Symfony\Set\SymfonySetList;
|
|
|
-use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
+use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
|
|
|
+use Rector\Config\RectorConfig;
|
|
|
+use \Rector\Symfony\Set\SymfonySetList;
|
|
|
+
|
|
|
+return static function (RectorConfig $rectorConfig): void {
|
|
|
+ $rectorConfig->paths([
|
|
|
+ __DIR__ . '/config',
|
|
|
+ __DIR__ . '/public',
|
|
|
+ __DIR__ . '/src',
|
|
|
+ ]);
|
|
|
|
|
|
-return static function (ContainerConfigurator $containerConfigurator): void {
|
|
|
- // region Symfony Container
|
|
|
- $parameters = $containerConfigurator->parameters();
|
|
|
- $parameters->set(
|
|
|
- Option::SYMFONY_CONTAINER_XML_PATH_PARAMETER,
|
|
|
- __DIR__ . '/var/cache/dev/App_KernelDevDebugContainer.xml'
|
|
|
- );
|
|
|
- // endregion
|
|
|
- // Define what rule sets will be applied
|
|
|
- $containerConfigurator->import(DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES);
|
|
|
- $containerConfigurator->import(SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES);
|
|
|
- $containerConfigurator->import(SensiolabsSetList::FRAMEWORK_EXTRA_61);
|
|
|
- // get services (needed for register a single rule)
|
|
|
- // $services = $containerConfigurator->services();
|
|
|
// register a single rule
|
|
|
- // $services->set(TypedPropertyRector::class);
|
|
|
-};
|
|
|
+ $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
|
|
|
+ $rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/docker/App_KernelDockerDebugContainer.xml');
|
|
|
+
|
|
|
+ $rectorConfig->sets([
|
|
|
+ SymfonySetList::SYMFONY_60,
|
|
|
+ SymfonySetList::SYMFONY_CODE_QUALITY,
|
|
|
+ SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
|
|
|
+ ]);
|
|
|
+};
|