-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
55 lines (45 loc) · 1.91 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* This file is part of the todocler package.
*
* (C) Alan Gabriel Bem <alan.bem@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
use Rector\Core\Configuration\Option;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Set\SymfonySetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $configurator) : void {
// get parameters
$parameters = $configurator->parameters();
// Define what rule sets will be applied
$configurator->import(PHPUnitSetList::PHPUNIT_91);
$configurator->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY);
$configurator->import(PHPUnitSetList::PHPUNIT_EXCEPTION);
$configurator->import(PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD);
$configurator->import(PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD);
$configurator->import(PHPUnitSetList::PHPUNIT_YIELD_DATA_PROVIDER);
$configurator->import(SetList::EARLY_RETURN);
$configurator->import(SetList::PHP_74);
$configurator->import(SetList::PHP_80);
$configurator->import(SetList::PRIVATIZATION);
$configurator->import(SymfonySetList::SYMFONY_52);
$parameters->set(Option::SKIP, [
]);
// paths to refactor; solid alternative to CLI arguments
$parameters->set(Option::PATHS, [
__DIR__.'/src',
__DIR__.'/tests',
]);
// // auto import fully qualified class names? [default: false]
// $parameters->set(Option::AUTO_IMPORT_NAMES, true);
// // skip root namespace classes, like \DateTime or \Exception [default: true]
$parameters->set(Option::IMPORT_SHORT_CLASSES, true);
// Run Rector only on changed files
$parameters->set(Option::ENABLE_CACHE, true);
$parameters->set(Option::CACHE_DIR, __DIR__.'/build/.rector');
};