forked from drush-ops/drush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
28 lines (25 loc) · 1.4 KB
/
rector.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
declare(strict_types=1);
use Rector\Core\Configuration\Option;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\FunctionLike\ParamTypeDeclarationRector;
use Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$containerConfigurator->import(SetList::CODE_QUALITY);
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
$parameters->set(Option::IMPORT_SHORT_CLASSES, false);
$src = [__DIR__ . '/src'];
$parameters->set(Option::SKIP, [
\Rector\CodeQuality\Rector\Identical\StrlenZeroToIdenticalEmptyStringRector::class => $src,
\Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector::class => $src,
\Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector::class => $src,
\Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector::class => $src,
\Rector\CodeQuality\Rector\If_\CombineIfRector::class => $src,
\Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector::class => $src,
]);
$services = $containerConfigurator->services();
$services->set(ParamTypeDeclarationRector::class);
$services->set(ReturnTypeDeclarationRector::class);
};