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