2023-04-20 20:00:38 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/** @noinspection DevelopmentDependenciesUsageInspection */
|
2022-10-22 15:09:09 +02:00
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector;
|
|
|
|
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
|
|
|
|
use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector;
|
|
|
|
use Rector\Config\RectorConfig;
|
|
|
|
use Rector\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector;
|
|
|
|
use Rector\Php81\Rector\ClassConst\FinalizePublicClassConstantRector;
|
|
|
|
use Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector;
|
|
|
|
use Rector\Set\ValueObject\LevelSetList;
|
|
|
|
use Rector\Set\ValueObject\SetList;
|
2023-04-20 20:00:38 +02:00
|
|
|
use RectorLaravel\Set\LaravelSetList;
|
2022-10-22 15:09:09 +02:00
|
|
|
|
|
|
|
return static function (RectorConfig $rectorConfig): void {
|
|
|
|
$rectorConfig->paths([
|
2023-04-20 20:00:38 +02:00
|
|
|
__DIR__.'/app',
|
|
|
|
__DIR__.'/config',
|
|
|
|
__DIR__.'/database',
|
2022-10-22 15:09:09 +02:00
|
|
|
]);
|
|
|
|
|
|
|
|
// define sets of rules
|
|
|
|
$rectorConfig->sets([
|
|
|
|
SetList::PHP_80,
|
|
|
|
SetList::PHP_81,
|
2023-04-20 20:00:38 +02:00
|
|
|
SetList::PHP_82,
|
|
|
|
LevelSetList::UP_TO_PHP_82,
|
2022-10-22 15:09:09 +02:00
|
|
|
SetList::CODE_QUALITY,
|
|
|
|
SetList::CODING_STYLE,
|
|
|
|
SetList::DEAD_CODE,
|
|
|
|
SetList::EARLY_RETURN,
|
|
|
|
SetList::MYSQL_TO_MYSQLI,
|
|
|
|
SetList::PSR_4,
|
|
|
|
SetList::PRIVATIZATION,
|
2023-04-20 20:00:38 +02:00
|
|
|
SetList::TYPE_DECLARATION,
|
|
|
|
LaravelSetList::LARAVEL_90,
|
|
|
|
LaravelSetList::LARAVEL_CODE_QUALITY,
|
2022-10-22 15:09:09 +02:00
|
|
|
]);
|
|
|
|
|
|
|
|
$rectorConfig->skip([
|
|
|
|
EncapsedStringsToSprintfRector::class,
|
|
|
|
WrapEncapsedVariableInCurlyBracesRector::class,
|
|
|
|
RenameParamToMatchTypeRector::class,
|
|
|
|
FinalizeClassesWithoutChildrenRector::class,
|
|
|
|
FinalizePublicClassConstantRector::class,
|
2023-04-20 20:00:38 +02:00
|
|
|
CatchExceptionNameMatchingTypeRector::class,
|
2022-10-22 15:09:09 +02:00
|
|
|
]);
|
|
|
|
};
|