Skip to content

Commit 8ee5560

Browse files
authored
Upgrade Rector dependency (#1186)
1 parent 46a0eda commit 8ee5560

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"require-dev": {
2323
"doctrine/coding-standard": "^12.0",
24-
"rector/rector": "^0.16.0",
24+
"rector/rector": "^0.18",
2525
"squizlabs/php_codesniffer": "^3.7",
2626
"symfony/phpunit-bridge": "^5.2",
2727
"vimeo/psalm": "^5.13"

rector.php

+5-15
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
use Rector\Config\RectorConfig;
44
use Rector\DeadCode\Rector\ClassLike\RemoveAnnotationRector;
5-
use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector;
6-
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
5+
use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector;
76
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
87
use Rector\Set\ValueObject\LevelSetList;
9-
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
108

119
return static function (RectorConfig $rectorConfig): void {
1210
$rectorConfig->paths([
@@ -19,24 +17,16 @@
1917
// Modernize code
2018
$rectorConfig->sets([LevelSetList::UP_TO_PHP_74]);
2119

20+
// phpcs:disable Squiz.Arrays.ArrayDeclaration.KeySpecified
2221
$rectorConfig->skip([
23-
// Falsely detect unassigned variables in code paths stopped by PHPUnit\Framework\Assert::markTestSkipped()
24-
AddDefaultValueForUndefinedVariableRector::class => [
25-
__DIR__ . '/tests/',
26-
],
27-
// @see https://github.com/phpstan/phpstan-src/pull/2429
28-
RemoveExtraParametersRector::class => [
29-
__DIR__ . '/src/Operation/',
30-
],
31-
// Assigns wrong type due to outdated PHPStan stubs
32-
TypedPropertyFromAssignsRector::class => [
33-
__DIR__ . '/src/Model/BSONIterator.php',
34-
],
22+
// Do not use ternaries extensively
23+
IfIssetToCoalescingRector::class,
3524
// Not necessary in documentation examples
3625
JsonThrowOnErrorRector::class => [
3726
__DIR__ . '/tests/DocumentationExamplesTest.php',
3827
],
3928
]);
29+
// phpcs:enable
4030

4131
// All classes are public API by default, unless marked with @internal.
4232
$rectorConfig->ruleWithConfiguration(RemoveAnnotationRector::class, ['api']);

0 commit comments

Comments
 (0)