Skip to content

Commit

Permalink
Remove redundant import and improve Rector setup
Browse files Browse the repository at this point in the history
Removed the unused `PhpUnitTestClassRequiresCoversFixer` import from `ecs.php`. Enhanced the Rector configuration in `rector.php` by adding Symfony sets for code quality, constructor injection, and validator attributes, while keeping imports organized and removing unused imports.
  • Loading branch information
Spomky committed Oct 31, 2024
1 parent c9f6906 commit 9139a31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use PhpCsFixer\Fixer\PhpTag\LinebreakAfterOpeningTagFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestCaseStaticMethodCallsFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestClassRequiresCoversFixer;
use PhpCsFixer\Fixer\ReturnNotation\SimplifiedNullReturnFixer;
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
use PhpCsFixer\Fixer\Strict\StrictComparisonFixer;
Expand All @@ -31,6 +30,7 @@
$header = '';

return static function (ECSConfig $config) use ($header): void {
$header = '';
$config->import(SetList::PSR_12);
$config->import(SetList::CLEAN_CODE);
$config->import(SetList::DOCTRINE_ANNOTATIONS);
Expand Down
11 changes: 9 additions & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,26 @@
return static function (RectorConfig $config): void {
$config->import(SetList::DEAD_CODE);
$config->import(LevelSetList::UP_TO_PHP_82);
$config->import(SymfonySetList::SYMFONY_64);
$config->import(SymfonySetList::SYMFONY_50_TYPES);
$config->import(SymfonySetList::SYMFONY_52_VALIDATOR_ATTRIBUTES);
$config->import(SymfonySetList::SYMFONY_CODE_QUALITY);
$config->import(PHPUnitSetList::PHPUNIT_110);
$config->import(SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION);
$config->import(SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES);
$config->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY);
$config->import(PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES);
$config->import(PHPUnitSetList::PHPUNIT_110);
$config->parallel();
$config->paths([__DIR__ . '/src', __DIR__ . '/tests']);
$config->skip(
[
__DIR__ . '/src/IndefiniteLengthMapObject.php',
__DIR__ . '/src/MapObject.php',
PreferPHPUnitThisCallRector::class,
]
);
$config->phpVersion(PhpVersion::PHP_82);
$config->parallel();
$config->importNames();
$config->importShortClasses();
$config->removeUnusedImports();
};

0 comments on commit 9139a31

Please sign in to comment.