|
40 | 40 | use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
|
41 | 41 | use Rector\Php70\Rector\FuncCall\RandomFunctionRector;
|
42 | 42 | use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
|
| 43 | +use Rector\Php80\Rector\Class_\AnnotationToAttributeRector; |
| 44 | +use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector; |
| 45 | +use Rector\Php80\Rector\FunctionLike\MixedTypeRector; |
| 46 | +use Rector\Php81\Rector\ClassConst\FinalizePublicClassConstantRector; |
| 47 | +use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector; |
| 48 | +use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector; |
| 49 | +use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\CoversAnnotationWithValueToAttributeRector; |
| 50 | +use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DataProviderAnnotationToAttributeRector; |
| 51 | +use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DependsAnnotationWithValueToAttributeRector; |
43 | 52 | use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector;
|
44 | 53 | use Rector\PHPUnit\Set\PHPUnitSetList;
|
45 | 54 | use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
|
46 | 55 | use Rector\Set\ValueObject\LevelSetList;
|
47 | 56 | use Rector\Set\ValueObject\SetList;
|
48 | 57 | use Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector;
|
| 58 | +use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector; |
49 | 59 | use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;
|
50 | 60 | use Utils\Rector\PassStrictParameterToFunctionParameterRector;
|
51 | 61 | use Utils\Rector\RemoveErrorSuppressInTryCatchStmtsRector;
|
|
54 | 64 | return static function (RectorConfig $rectorConfig): void {
|
55 | 65 | $rectorConfig->sets([
|
56 | 66 | SetList::DEAD_CODE,
|
57 |
| - LevelSetList::UP_TO_PHP_74, |
| 67 | + LevelSetList::UP_TO_PHP_81, |
58 | 68 | PHPUnitSetList::PHPUNIT_CODE_QUALITY,
|
59 | 69 | PHPUnitSetList::PHPUNIT_100,
|
60 | 70 | ]);
|
|
130 | 140 | RandomFunctionRector::class,
|
131 | 141 |
|
132 | 142 | SimplifyRegexPatternRector::class,
|
| 143 | + |
| 144 | + // PHP 8.0 features but cause breaking changes |
| 145 | + ClassPropertyAssignToConstructorPromotionRector::class => [ |
| 146 | + __DIR__ . '/system/Database/BaseResult.php', |
| 147 | + __DIR__ . '/system/Database/RawSql.php', |
| 148 | + __DIR__ . '/system/Debug/BaseExceptionHandler.php', |
| 149 | + __DIR__ . '/system/Filters/Filters.php', |
| 150 | + __DIR__ . '/system/HTTP/CURLRequest.php', |
| 151 | + __DIR__ . '/system/HTTP/DownloadResponse.php', |
| 152 | + __DIR__ . '/system/HTTP/IncomingRequest.php', |
| 153 | + __DIR__ . '/system/Security/Security.php', |
| 154 | + __DIR__ . '/system/Session/Session.php', |
| 155 | + ], |
| 156 | + MixedTypeRector::class, |
| 157 | + |
| 158 | + // PHP 8.1 features but cause breaking changes |
| 159 | + FinalizePublicClassConstantRector::class => [ |
| 160 | + __DIR__ . '/system/Cache/Handlers/BaseHandler.php', |
| 161 | + __DIR__ . '/system/Cache/Handlers/FileHandler.php', |
| 162 | + __DIR__ . '/system/CodeIgniter.php', |
| 163 | + __DIR__ . '/system/Events/Events.php', |
| 164 | + __DIR__ . '/system/Log/Handlers/ChromeLoggerHandler.php', |
| 165 | + __DIR__ . '/system/Log/Handlers/ErrorlogHandler.php', |
| 166 | + __DIR__ . '/system/Security/Security.php', |
| 167 | + ], |
| 168 | + ReturnNeverTypeRector::class => [ |
| 169 | + __DIR__ . '/system/Cache/Handlers/MemcachedHandler.php', |
| 170 | + __DIR__ . '/system/Cache/Handlers/WincacheHandler.php', |
| 171 | + __DIR__ . '/system/CodeIgniter.php', |
| 172 | + __DIR__ . '/system/Database/MySQLi/Utils.php', |
| 173 | + __DIR__ . '/system/Database/OCI8/Utils.php', |
| 174 | + __DIR__ . '/system/Database/Postgre/Utils.php', |
| 175 | + __DIR__ . '/system/Database/SQLSRV/Utils.php', |
| 176 | + __DIR__ . '/system/Database/SQLite3/Utils.php', |
| 177 | + __DIR__ . '/system/HTTP/DownloadResponse.php', |
| 178 | + __DIR__ . '/system/HTTP/SiteURI.php', |
| 179 | + __DIR__ . '/system/Helpers/kint_helper.php', |
| 180 | + ], |
| 181 | + |
| 182 | + // Unnecessary (string) is inserted |
| 183 | + NullToStrictStringFuncCallArgRector::class, |
| 184 | + |
| 185 | + // PHPUnit 10 (requires PHP 8.1) features |
| 186 | + DataProviderAnnotationToAttributeRector::class, |
| 187 | + DependsAnnotationWithValueToAttributeRector::class, |
| 188 | + AnnotationWithValueToAttributeRector::class, |
| 189 | + AnnotationToAttributeRector::class, |
| 190 | + CoversAnnotationWithValueToAttributeRector::class, |
133 | 191 | ]);
|
134 | 192 |
|
135 | 193 | // auto import fully qualified class names
|
|
0 commit comments