forked from relaticle/relaticle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
50 lines (47 loc) · 1.92 KB
/
rector.php
File metadata and controls
50 lines (47 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
declare(strict_types=1);
use Rector\CodingStyle\Rector\ArrowFunction\ArrowFunctionDelegatingCallToFirstClassCallableRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
use Rector\Php81\Rector\Array_\ArrayToFirstClassCallableRector;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector;
use RectorLaravel\Set\LaravelSetProvider;
return RectorConfig::configure()
->withSetProviders(LaravelSetProvider::class)
->withComposerBased(laravel: true)
->withPaths([
__DIR__.'/app',
__DIR__.'/app-modules',
__DIR__.'/bootstrap/app.php',
__DIR__.'/config',
__DIR__.'/database',
__DIR__.'/public',
])
->withSkip([
AddOverrideAttributeToOverriddenMethodsRector::class,
RemoveUnusedPrivateMethodRector::class => [
// Skip Filament importer lifecycle hooks - they're called dynamically via callHook()
__DIR__.'/app/Filament/Imports/*',
],
PrivatizeFinalClassMethodRector::class => [
// Filament expects protected visibility for lifecycle hooks
__DIR__.'/app/Filament/Imports/*',
],
ArrayToFirstClassCallableRector::class => [
// class_exists has optional bool param that conflicts with Collection::first signature
__DIR__.'/app/Providers/AppServiceProvider.php',
],
ArrowFunctionDelegatingCallToFirstClassCallableRector::class => [
// class_exists has optional bool param that conflicts with Collection::first signature
__DIR__.'/app/Providers/AppServiceProvider.php',
],
])
->withPreparedSets(
deadCode: true,
codeQuality: true,
typeDeclarations: true,
privatization: true,
earlyReturn: true,
)
->withPhpSets();