Repository navigation
Expand file tree
/
Copy pathrector.php
More file actions
40 lines (37 loc) · 1.59 KB
/
Copy pathrector.php
File metadata and controls
40 lines (37 loc) · 1.59 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\MethodCall\RemoveNullArgOnNullDefaultParamRector;
use RectorLaravel\Set\LaravelLevelSetList;
/*
* Library, not an application: no privatization and no "treat classes as
* final" here. Apps extend a plugin's classes and override its protected
* methods; Rector cannot see those subclasses, so narrowing visibility or
* finalizing classes would break them without a failing test in this repository.
*/
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
// The LOWEST Laravel the package supports, not the installed one:
// `withComposerBased(laravel: true)` would follow the newest Laravel that
// `composer update` resolves and rewrite code into forms (e.g. Laravel 13
// Eloquent attributes) that break the older versions CI still tests.
// Raise it when the package drops a Laravel version.
->withSets([
LaravelLevelSetList::UP_TO_LARAVEL_120,
])
->withPreparedSets(
deadCode: true,
codeQuality: true,
typeDeclarations: true,
earlyReturn: true,
)
->withPhpSets()
->withSkip([
// Trusts the Filament facade's `@method` docblock, which shows `setCurrentPanel(Panel|string|null
// $panel = null)` — but FilamentManager::setCurrentPanel() has no default; removing the explicit
// `null` argument here throws ArgumentCountError at runtime.
RemoveNullArgOnNullDefaultParamRector::class => [__DIR__ . '/tests/Feature/Attributes/RequiresMFATest.php'],
]);