2021-05-15 08:37:15 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare (strict_types=1);
|
2022-06-07 06:40:10 +00:00
|
|
|
namespace RectorPrefix20220607;
|
2021-05-15 08:37:15 +00:00
|
|
|
|
2022-06-06 17:12:56 +00:00
|
|
|
use Rector\Config\RectorConfig;
|
|
|
|
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
|
|
|
|
use Rector\Set\ValueObject\LevelSetList;
|
|
|
|
use Rector\Set\ValueObject\SetList;
|
|
|
|
use Rector\Symfony\Set\SymfonySetList;
|
|
|
|
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
|
2022-06-07 08:22:29 +00:00
|
|
|
return static function (RectorConfig $rectorConfig) : void {
|
2022-04-20 14:29:16 +00:00
|
|
|
$rectorConfig->importNames();
|
|
|
|
$rectorConfig->paths([__DIR__ . '/src', __DIR__ . '/tests']);
|
|
|
|
$rectorConfig->parallel();
|
2022-06-06 06:00:07 +00:00
|
|
|
$rectorConfig->skip([
|
|
|
|
'*/Fixture/*',
|
|
|
|
'*/Source/*',
|
|
|
|
'*/Source*/*',
|
|
|
|
'*/tests/*/Fixture*/Expected/*',
|
2022-06-07 08:22:29 +00:00
|
|
|
StringClassNameToClassConstantRector::class => [__DIR__ . '/config'],
|
2022-06-06 17:12:56 +00:00
|
|
|
\Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchMethodCallReturnTypeRector::class => [
|
2022-06-06 06:00:07 +00:00
|
|
|
// "data" => "datum" false positive
|
|
|
|
__DIR__ . '/src/Rector/ClassMethod/AddRouteAnnotationRector.php',
|
|
|
|
],
|
|
|
|
// marked as skipped
|
2022-06-07 08:22:29 +00:00
|
|
|
ReturnNeverTypeRector::class => ['*/tests/*'],
|
2022-06-06 06:00:07 +00:00
|
|
|
]);
|
2022-06-07 08:22:29 +00:00
|
|
|
$rectorConfig->ruleWithConfiguration(StringClassNameToClassConstantRector::class, [
|
2022-05-21 09:54:08 +00:00
|
|
|
'Symfony\\*',
|
|
|
|
'Twig_*',
|
|
|
|
'Swift_*',
|
|
|
|
'Doctrine\\*',
|
|
|
|
// loaded from project itself
|
2022-06-07 09:38:27 +00:00
|
|
|
'RectorPrefix20220607\\Psr\\Container\\ContainerInterface',
|
|
|
|
'RectorPrefix20220607\\Symfony\\Component\\Routing\\RouterInterface',
|
|
|
|
'RectorPrefix20220607\\Symfony\\Component\\DependencyInjection\\Container',
|
2022-05-21 09:54:08 +00:00
|
|
|
]);
|
2022-01-04 16:28:21 +00:00
|
|
|
// for testing
|
2022-04-13 16:29:57 +00:00
|
|
|
$rectorConfig->import(__DIR__ . '/config/config.php');
|
2022-06-07 08:22:29 +00:00
|
|
|
$rectorConfig->sets([LevelSetList::UP_TO_PHP_81, SetList::CODE_QUALITY, SetList::DEAD_CODE, SetList::NAMING, SymfonySetList::SYMFONY_60]);
|
2021-05-15 08:37:15 +00:00
|
|
|
};
|