-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrector.php
More file actions
83 lines (76 loc) · 2.41 KB
/
Copy pathrector.php
File metadata and controls
83 lines (76 loc) · 2.41 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
<?php
/*
* This file is part of the HighchartsBundle 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\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\CodeQuality\Rector\ClassMethod\NoSetupWithParentCallOverrideRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Set\TwigSetList;
$paths = [
__DIR__ . '/src',
__DIR__ . '/tests',
__DIR__ . '/rector.php',
];
$skip = [
// allow self::functions for PHP unit
PreferPHPUnitThisCallRector::class,
// no space before or after statements
NewlineAfterStatementRector::class,
NewlineBeforeNewAssignSetRector::class,
// don't separate constants
NewlineBetweenClassLikeStmtsRector::class,
// don't rename exception
CatchExceptionNameMatchingTypeRector::class,
// allow delegate constructor
RemoveParentDelegatingConstructorRector::class,
// allow override attribute for setUp method in tests
NoSetupWithParentCallOverrideRector::class,
];
$sets = [
// global
SetList::PHP_83,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::INSTANCEOF,
SetList::PRIVATIZATION,
SetList::TYPE_DECLARATION,
// PHP-Unit
PHPUnitSetList::PHPUNIT_120,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::PHPUNIT_MOCK_TO_STUB,
PHPUnitSetList::PHPUNIT_NARROW_ASSERTS,
// twig
TwigSetList::TWIG_24,
TwigSetList::TWIG_UNDERSCORE_TO_NAMESPACE,
];
return RectorConfig::configure()
->withCache(__DIR__ . '/cache/rector')
->withRootFiles()
->reportUnusedSkips()
->withPaths($paths)
->withSkip($skip)
->withSets($sets)
->withComposerBased(
twig: true,
phpunit: true,
symfony: true,
)->withPhpSets(
php83: true
)->withAttributesSets(
symfony: true,
phpunit: true
);