Repository navigation
Expand file tree
/
Copy pathrector.php
More file actions
90 lines (83 loc) · 2.76 KB
/
Copy pathrector.php
File metadata and controls
90 lines (83 loc) · 2.76 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
/*
* This file is part of the Calculation package.
*
* (c) bibi.nu <bibi@bibi.nu>
*
* 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\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector;
use Rector\CodingStyle\Rector\ClassLike\NewlineBetweenClassLikeStmtsRector;
use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Config\RectorConfig;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\CodeQuality\Rector\ClassMethod\NoSetupWithParentCallOverrideRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\SetList;
$paths = [
__DIR__ . '/config',
__DIR__ . '/src',
__DIR__ . '/tests',
__DIR__ . '/public',
];
$skip = [
// allow self::functions for PHP unit
PreferPHPUnitThisCallRector::class,
// not convert class-string to class
StringClassNameToClassConstantRector::class => [
__DIR__ . '/tests/Traits/CheckSubClassTraitTest.php',
],
// not update method visibility
MakeInheritedMethodVisibilitySameAsParentRector::class => [
__DIR__ . '/tests/Fixture',
],
// no space before or after statements
NewlineAfterStatementRector::class,
NewlineBeforeNewAssignSetRector::class,
// don't separate constants
NewlineBetweenClassLikeStmtsRector::class,
// don't rename exception
CatchExceptionNameMatchingTypeRector::class,
// allow override attribute for setUp method in tests
NoSetupWithParentCallOverrideRector::class,
];
$sets = [
// global
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::PRIVATIZATION,
SetList::TYPE_DECLARATION,
// Doctrine
DoctrineSetList::DOCTRINE_CODE_QUALITY,
DoctrineSetList::TYPED_COLLECTIONS,
DoctrineSetList::TYPED_COLLECTIONS_DOCBLOCKS,
// PHP-Unit
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::PHPUNIT_MOCK_TO_STUB,
PHPUnitSetList::PHPUNIT_NARROW_ASSERTS,
];
return RectorConfig::configure()
->withCache(__DIR__ . '/var/cache/rector')
->withRootFiles()
->reportUnusedSkips()
->withPhpSets(php83: true)
->withPaths($paths)
->withSkip($skip)
->withSets($sets)
->withComposerBased(
twig: true,
doctrine: true,
phpunit: true,
symfony: true,
)->withAttributesSets(
symfony: true,
doctrine: true,
phpunit: true,
);