diff --git a/composer.json b/composer.json index 603712611..cda6313a7 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ }, "require-dev": { "doctrine/coding-standard": "^12.0", - "rector/rector": "^0.16.0", + "rector/rector": "^0.18", "squizlabs/php_codesniffer": "^3.7", "symfony/phpunit-bridge": "^5.2", "vimeo/psalm": "^5.13" diff --git a/rector.php b/rector.php index 714486473..0a8995c7b 100644 --- a/rector.php +++ b/rector.php @@ -2,11 +2,9 @@ use Rector\Config\RectorConfig; use Rector\DeadCode\Rector\ClassLike\RemoveAnnotationRector; -use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector; -use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector; +use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector; use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; use Rector\Set\ValueObject\LevelSetList; -use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; return static function (RectorConfig $rectorConfig): void { $rectorConfig->paths([ @@ -19,24 +17,16 @@ // Modernize code $rectorConfig->sets([LevelSetList::UP_TO_PHP_74]); + // phpcs:disable Squiz.Arrays.ArrayDeclaration.KeySpecified $rectorConfig->skip([ - // Falsely detect unassigned variables in code paths stopped by PHPUnit\Framework\Assert::markTestSkipped() - AddDefaultValueForUndefinedVariableRector::class => [ - __DIR__ . '/tests/', - ], - // @see https://github.com/phpstan/phpstan-src/pull/2429 - RemoveExtraParametersRector::class => [ - __DIR__ . '/src/Operation/', - ], - // Assigns wrong type due to outdated PHPStan stubs - TypedPropertyFromAssignsRector::class => [ - __DIR__ . '/src/Model/BSONIterator.php', - ], + // Do not use ternaries extensively + IfIssetToCoalescingRector::class, // Not necessary in documentation examples JsonThrowOnErrorRector::class => [ __DIR__ . '/tests/DocumentationExamplesTest.php', ], ]); + // phpcs:enable // All classes are public API by default, unless marked with @internal. $rectorConfig->ruleWithConfiguration(RemoveAnnotationRector::class, ['api']);