-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
45 lines (41 loc) · 1.66 KB
/
rector.php
File metadata and controls
45 lines (41 loc) · 1.66 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
41
42
43
44
45
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\Config\RectorConfig;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
use Rector\ValueObject\PhpVersion;
return RectorConfig
::configure()
->withPhpVersion(PhpVersion::PHP_84)
->withPreparedSets(deadCode: true, instanceOf: true)
->withComposerBased(twig: true, doctrine: true, phpunit: true, symfony: true)
->withPhpSets(php84: true)
->withAttributesSets(all: true)
->withImportNames(importShortClasses: false, removeUnusedImports: true)
->withRules([
InlineConstructorDefaultToPropertyRector::class,
])
->withConfiguredRule(TypedPropertyFromAssignsRector::class, [
'inline_public' => true,
])
->withSkip([
// Ne pas forcer l’utilisation de "if ($foo instanceof \Foo)" au lieu de "if (null !== $foo)"
FlipTypeControlToUseExclusiveTypeRector::class,
// Ne pas forcer la mise en place de l’attribut "#[Override]"
AddOverrideAttributeToOverriddenMethodsRector::class,
])
// À incrémenter au fur et à mesure
->withTypeCoverageLevel(5)
->withTypeCoverageDocblockLevel(0)
->withPaths([__DIR__ . '/src'])
// ->withSets([
// SymfonySetList::SYMFONY_CODE_QUALITY,
// SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
// ])
// ->withSkip([
// JsonThrowOnErrorRector::class,
// AddLiteralSeparatorToNumberRector::class,
// ])
;