-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Phil Bates
committed
Jan 22, 2024
1 parent
fcee04e
commit 54e9577
Showing
4 changed files
with
171 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
use Rector\Set\ValueObject\LevelSetList; | ||
use Rector\PHPUnit\Set\PHPUnitSetList; | ||
use Rector\Set\ValueObject\SetList; | ||
use RectorLaravel\Set\LaravelSetList; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
$rectorConfig->paths([ | ||
__DIR__ . '/app', | ||
__DIR__ . '/bootstrap', | ||
__DIR__ . '/config', | ||
__DIR__ . '/public', | ||
__DIR__ . '/resources', | ||
__DIR__ . '/routes', | ||
__DIR__ . '/tests', | ||
]); | ||
|
||
$rectorConfig->skip([ | ||
__DIR__ . '/bootstrap/cache', | ||
]); | ||
|
||
// Larastan's bootstrap file doesn't run when Rector boots PHPStan, so we need to include it manually. See: | ||
// * https://github.com/rectorphp/rector/issues/8006 | ||
// * https://github.com/larastan/larastan/issues/1664#issuecomment-1637152828 | ||
$rectorConfig->bootstrapFiles([__DIR__ . '/vendor/larastan/larastan/bootstrap.php']); | ||
$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon.dist'); | ||
|
||
$rectorConfig->sets([ | ||
LevelSetList::UP_TO_PHP_83, | ||
LaravelSetList::LARAVEL_100, | ||
PHPUnitSetList::PHPUNIT_100, | ||
|
||
// High hit sets - Run all the time | ||
SetList::CODE_QUALITY, | ||
// SetList::CODING_STYLE, // Let php-cs-fixer handle this | ||
SetList::DEAD_CODE, | ||
SetList::STRICT_BOOLEANS, | ||
// SetList::GMAGICK_TO_IMAGICK, // We don't use this | ||
SetList::NAMING, | ||
SetList::PRIVATIZATION, | ||
SetList::TYPE_DECLARATION, | ||
SetList::EARLY_RETURN, | ||
SetList::INSTANCEOF, | ||
// LaravelSetList::LARAVEL_STATIC_TO_INJECTION, | ||
LaravelSetList::LARAVEL_CODE_QUALITY, | ||
// LaravelSetList::LARAVEL_LEGACY_FACTORIES_TO_CLASSES, | ||
LaravelSetList::LARAVEL_FACADE_ALIASES_TO_FULL_NAMES, | ||
LaravelSetList::LARAVEL_ELOQUENT_MAGIC_METHOD_TO_QUERY_BUILDER, | ||
PHPUnitSetList::PHPUNIT_CODE_QUALITY, | ||
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES, | ||
]); | ||
}; |