-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrector.php
More file actions
68 lines (60 loc) · 1.91 KB
/
Copy pathrector.php
File metadata and controls
68 lines (60 loc) · 1.91 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
<?php
/*
* This file is part of the FPDF2 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\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\SetList;
$paths = [
__DIR__ . '/src',
__DIR__ . '/tests',
__DIR__ . '/rector.php',
];
$skips = [
__DIR__ . '/tests/fonts',
PreferPHPUnitThisCallRector::class,
// no space before or after statements
NewlineAfterStatementRector::class,
NewlineBeforeNewAssignSetRector::class,
// don't separate constants
NewlineBetweenClassLikeStmtsRector::class,
// don't rename exception
CatchExceptionNameMatchingTypeRector::class,
];
$sets = [
// global
SetList::PHP_83,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::INSTANCEOF,
SetList::PRIVATIZATION,
SetList::TYPE_DECLARATION,
SetList::IF,
// PHP-Unit
PHPUnitSetList::PHPUNIT_120,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::PHPUNIT_MOCK_TO_STUB,
PHPUnitSetList::PHPUNIT_NARROW_ASSERTS,
];
return RectorConfig::configure()
->withCache(__DIR__ . '/cache/rector')
->withRootFiles()
->withPaths($paths)
->withSkip($skips)
->withSets($sets)
->withConfiguredRule(ClassPropertyAssignToConstructorPromotionRector::class, [
'rename_property' => false,
]);