Skip to content

Commit

Permalink
Bump to Rector 1.0 (#205)
Browse files Browse the repository at this point in the history
* Bump to Rector 1.0

* re-run rector

* skip scoper.php

* skip scoper.php
  • Loading branch information
samsonasik committed May 18, 2024
1 parent bab4954 commit 847639a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 30 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^10.5",
"rector/rector": "^0.19",
"rector/rector": "^1.0",
"symplify/phpstan-extensions": "^11.4",
"symplify/vendor-patches": "^11.3",
"tomasvotruba/class-leak": "^0.2",
Expand Down
46 changes: 17 additions & 29 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,27 @@

use Rector\Config\RectorConfig;
use Rector\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_82,
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
SetList::CODING_STYLE,
SetList::TYPE_DECLARATION,
SetList::NAMING,
SetList::PRIVATIZATION,
SetList::EARLY_RETURN,
]);

$rectorConfig->paths([
__DIR__ . '/ecs.php',
__DIR__ . '/rector.php',
__DIR__ . '/config',
__DIR__ . '/src',
__DIR__ . '/config',
__DIR__ . '/tests',
]);

$rectorConfig->importNames();

$rectorConfig->bootstrapFiles([__DIR__ . '/tests/bootstrap.php']);

$rectorConfig->skip([
return RectorConfig::configure()
->withPhpSets(php82: true)
->withPreparedSets(
codeQuality: true,
deadCode: true,
codingStyle: true,
typeDeclarations: true,
naming: true,
privatization: true,
earlyReturn: true
)
->withPaths([__DIR__ . '/config', __DIR__ . '/src', __DIR__ . '/config', __DIR__ . '/tests'])
->withRootFiles()
->withImportNames()
->withBootstrapFiles([__DIR__ . '/tests/bootstrap.php'])
->withSkip([
'*/Source/*',
'*/Fixture/*',
__DIR__ . '/src/SniffRunner/ValueObject/File.php',
__DIR__ . '/scoper.php',

RenameParamToMatchTypeRector::class => [__DIR__ . '/src/FixerRunner/Application/FixerFileProcessor.php'],
]);
};

0 comments on commit 847639a

Please sign in to comment.