Skip to content

Commit

Permalink
chore: change for upgrade to PHP 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Sep 23, 2023
1 parent 760dbf4 commit bca38ca
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
use Rector\Php70\Rector\FuncCall\RandomFunctionRector;
use Rector\Php71\Rector\FuncCall\CountOnNullRector;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\CoversAnnotationWithValueToAttributeRector;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DataProviderAnnotationToAttributeRector;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DependsAnnotationWithValueToAttributeRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
Expand All @@ -50,7 +57,7 @@
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
SetList::DEAD_CODE,
LevelSetList::UP_TO_PHP_74,
LevelSetList::UP_TO_PHP_80,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::PHPUNIT_100,
]);
Expand Down Expand Up @@ -112,6 +119,17 @@
RandomFunctionRector::class,

SimplifyRegexPatternRector::class,

// PHP 8.0 features but cause breaking changes
ClassPropertyAssignToConstructorPromotionRector::class,
MixedTypeRector::class,

// PHPUnit 10 (requires PHP 8.1) features
DataProviderAnnotationToAttributeRector::class,
DependsAnnotationWithValueToAttributeRector::class,
AnnotationWithValueToAttributeRector::class,
AnnotationToAttributeRector::class,
CoversAnnotationWithValueToAttributeRector::class,
]);

// auto import fully qualified class names
Expand Down

0 comments on commit bca38ca

Please sign in to comment.