48 lines
1.3 KiB
Markdown
48 lines
1.3 KiB
Markdown
---
|
|
created: 2025-03-17 14:03
|
|
updated: 2025-07-04 07:25
|
|
tags:
|
|
- Laravel/Packages
|
|
---
|
|
|
|
|
|
```bash
|
|
composer require driftingly/rector-laravel && ./vendor/bin/rector
|
|
```
|
|
|
|
```php. rector
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Rector\Config\RectorConfig;
|
|
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
|
|
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
|
|
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
|
|
use RectorLaravel\Set\LaravelSetList;
|
|
|
|
return RectorConfig::configure()
|
|
->withPaths([
|
|
// bla bla
|
|
])
|
|
->withPhpSets()
|
|
->withSkip([
|
|
ClosureToArrowFunctionRector::class,
|
|
AddOverrideAttributeToOverriddenMethodsRector::class,
|
|
AddVoidReturnTypeWhereNoReturnRector::class,
|
|
])
|
|
->withPreparedSets(
|
|
deadCode : true,
|
|
codeQuality : true,
|
|
typeDeclarations: true,
|
|
privatization : true,
|
|
)
|
|
->withSets([
|
|
LaravelSetList::LARAVEL_110,
|
|
LaravelSetList::LARAVEL_CODE_QUALITY,
|
|
LaravelSetList::LARAVEL_ELOQUENT_MAGIC_METHOD_TO_QUERY_BUILDER,
|
|
LaravelSetList::LARAVEL_CONTAINER_STRING_TO_FULLY_QUALIFIED_NAME,
|
|
LaravelSetList::LARAVEL_COLLECTION,
|
|
]);
|
|
```
|