diff --git a/composer.json b/composer.json index b2fff2c..09830b2 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "nyholm/psr7": "^1.8.1", "phpstan/phpstan": "^1.10.63", "phpunit/phpunit": "^10.5.13", - "rector/rector": "^0.19.8", + "rector/rector": "^1.0.3", "symfony/http-client": "^6.4.5" }, "autoload": { diff --git a/composer.lock b/composer.lock index 67406e2..c3744d8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e0f51bb5eb1b6f943d87afeac5bd3b68", + "content-hash": "7ec877331192b998a4579c82ab6cf593", "packages": [ { "name": "nyholm/psr7", @@ -2289,21 +2289,21 @@ }, { "name": "rector/rector", - "version": "0.19.8", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "de3b3bb159abd704b144aa86fb244f7f1f4ac947" + "reference": "c59507a9090b465d65e1aceed91e5b81986e375b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/de3b3bb159abd704b144aa86fb244f7f1f4ac947", - "reference": "de3b3bb159abd704b144aa86fb244f7f1f4ac947", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/c59507a9090b465d65e1aceed91e5b81986e375b", + "reference": "c59507a9090b465d65e1aceed91e5b81986e375b", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.56" + "phpstan/phpstan": "^1.10.57" }, "conflict": { "rector/rector-doctrine": "*", @@ -2333,7 +2333,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.19.8" + "source": "https://github.com/rectorphp/rector/tree/1.0.3" }, "funding": [ { @@ -2341,7 +2341,7 @@ "type": "github" } ], - "time": "2024-02-05T10:59:13+00:00" + "time": "2024-03-14T15:04:18+00:00" }, { "name": "sebastian/cli-parser", diff --git a/rector.php b/rector.php index 501f265..65b5b0d 100644 --- a/rector.php +++ b/rector.php @@ -2,33 +2,32 @@ declare(strict_types=1); -use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector; use Rector\Config\RectorConfig; -use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; -return static function (RectorConfig $rectorConfig): void { - $rectorConfig->cacheDirectory(__DIR__ . '/var/cache/rector'); - - $rectorConfig->paths([ +return RectorConfig::configure() + ->withCache( + cacheDirectory: __DIR__ . '/var/cache/rector', + ) + ->withPaths([ __DIR__ . '/src', __DIR__ . '/tests', - ]); - - $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); - - $rectorConfig->skip([ + ]) + ->withSkip([ NewlineAfterStatementRector::class, - ]); - - $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_81, - SetList::DEAD_CODE, - SetList::CODE_QUALITY, - SetList::CODING_STYLE, - SetList::EARLY_RETURN, - SetList::TYPE_DECLARATION, - SetList::PRIVATIZATION, - ]); -}; + ]) + ->withPreparedSets( + deadCode: true, + codeQuality: true, + codingStyle: true, + typeDeclarations: true, + privatization: true, + earlyReturn: true, + instanceOf: true, + ) + ->withAttributesSets( + phpunit: true, + ) + ->withPhpSets() + ->withRootFiles() +;