-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Add Rector script and configuration (#56)
- Loading branch information
1 parent
311267b
commit 1aea6ed
Showing
2 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 project. | ||
* | ||
* (c) 2019-2022 Benni Mack | ||
* Simon Gilli | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
use Rector\Config\RectorConfig; | ||
use Rector\PHPUnit\Set\PHPUnitLevelSetList; | ||
use Rector\PHPUnit\Set\PHPUnitSetList; | ||
use Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector; | ||
use Rector\Set\ValueObject\DowngradeLevelSetList; | ||
use Rector\Set\ValueObject\LevelSetList; | ||
use Rector\Set\ValueObject\SetList; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
$rectorConfig->paths([ | ||
__DIR__ . '/src', | ||
__DIR__ . '/tests', | ||
]); | ||
|
||
$rectorConfig->skip([ | ||
__DIR__ . '/tests/Unit/Fixtures', | ||
|
||
FinalizeClassesWithoutChildrenRector::class => [ | ||
__DIR__ . '/src/CsFixerConfig.php', | ||
], | ||
]); | ||
|
||
// define sets of rules | ||
$rectorConfig->sets([ | ||
LevelSetList::UP_TO_PHP_72, | ||
DowngradeLevelSetList::DOWN_TO_PHP_72, | ||
SetList::CODE_QUALITY, | ||
SetList::CODING_STYLE, | ||
SetList::DEAD_CODE, | ||
SetList::NAMING, | ||
SetList::PRIVATIZATION, | ||
SetList::PSR_4, | ||
SetList::TYPE_DECLARATION, | ||
SetList::TYPE_DECLARATION_STRICT, | ||
SetList::EARLY_RETURN, | ||
|
||
// PHPUnit rules | ||
PHPUnitLevelSetList::UP_TO_PHPUNIT_80, | ||
PHPUnitSetList::PHPUNIT_CODE_QUALITY, | ||
PHPUnitSetList::PHPUNIT_EXCEPTION, | ||
PHPUnitSetList::REMOVE_MOCKS, | ||
PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, | ||
PHPUnitSetList::PHPUNIT_YIELD_DATA_PROVIDER, | ||
]); | ||
}; |