generated from spawnia/php-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
38 lines (36 loc) · 1.4 KB
/
rector.php
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
<?php declare(strict_types=1);
use Rector\CodeQuality\Rector\Concat\JoinStringConcatRector;
use Rector\Config\RectorConfig;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitSelfCallRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\SetList;
return RectorConfig::configure()
->withSets([
SetList::CODE_QUALITY,
SetList::TYPE_DECLARATION,
SetList::RECTOR_PRESET,
PHPUnitSetList::PHPUNIT_40,
PHPUnitSetList::PHPUNIT_50,
PHPUnitSetList::PHPUNIT_60,
PHPUnitSetList::PHPUNIT_70,
PHPUnitSetList::PHPUNIT_80,
PHPUnitSetList::PHPUNIT_90,
PHPUnitSetList::PHPUNIT_100,
PHPUnitSetList::PHPUNIT_110,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
])
->withPhpSets()
->withRules([PreferPHPUnitSelfCallRector::class])
->withSkip([
PreferPHPUnitThisCallRector::class, // breaks tests
JoinStringConcatRector::class => [
__DIR__ . '/tests/CSVArrayTest.php', // keep `\r\n` for readability
],
])
->withPaths([__DIR__ . '/src', __DIR__ . '/tests'])
->withBootstrapFiles([
// Rector uses PHPStan internally, which in turn requires Larastan to be set up correctly
__DIR__ . '/vendor/larastan/larastan/bootstrap.php',
])
->withPHPStanConfigs([__DIR__ . '/phpstan.neon']);