Repository navigation
Expand file tree
/
Copy pathrector.php
More file actions
40 lines (37 loc) · 1.48 KB
/
Copy pathrector.php
File metadata and controls
40 lines (37 loc) · 1.48 KB
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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/rector',
__DIR__ . '/tests',
__DIR__ . '/examples',
])
->withSkip([
__DIR__ . '/vendor',
__DIR__ . '/build',
__DIR__ . '/graphify-out',
// Bewusste Stilentscheidung: PHPUnit-Assertions werden statisch aufgerufen (self::assert*).
PreferPHPUnitThisCallRector::class,
// Im Upgrade-Set steht AbstractApi bewusst als String: Die Klasse ist @internal.
StringClassNameToClassConstantRector::class => [__DIR__ . '/rector/upgrade-4.0.php'],
])
->withPhpSets(php85: true)
->withSets([
LevelSetList::UP_TO_PHP_85,
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
SetList::TYPE_DECLARATION,
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
])
// Versionsspezifische PHPUnit-Regeln anhand der installierten PHPUnit-Version (ersetzt PHPUNIT_100 & Co.).
->withComposerBased(phpunit: true)
->withImportNames(importDocBlockNames: true, importShortClasses: false)
->withCache(cacheDirectory: __DIR__ . '/build/rector');