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