Skip to content

Commit

Permalink
Upgrade Rector dependency (#1186)
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark authored Nov 13, 2023
1 parent 46a0eda commit 8ee5560
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 5 additions & 15 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand All @@ -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']);
Expand Down

0 comments on commit 8ee5560

Please sign in to comment.