-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrector.php
More file actions
50 lines (47 loc) · 1.96 KB
/
Copy pathrector.php
File metadata and controls
50 lines (47 loc) · 1.96 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\Config\RectorConfig;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use RectorLaravel\Rector\ArrayDimFetch\ServerVariableToRequestFacadeRector;
use RectorLaravel\Rector\MethodCall\ContainerBindConcreteWithClosureOnlyRector;
use RectorLaravel\Set\LaravelLevelSetList;
use RectorLaravel\Set\LaravelSetList;
return RectorConfig::configure()
->withPaths([
__DIR__.'/src',
__DIR__.'/tests',
])
->withSkip([
AddOverrideAttributeToOverriddenMethodsRector::class,
ContainerBindConcreteWithClosureOnlyRector::class => [
__DIR__.'/src/Hook/Infrastructure/Providers/HookServiceProvider.php',
],
// laravelIsServingTheRequest() exists to answer "is Laravel serving
// this at all?" — it runs when PHP is executing wp-login.php or
// wp-admin, where the application may not be bound. The facade needs
// the very container whose absence the method is detecting, so reading
// $_SERVER directly is the point rather than an oversight.
ServerVariableToRequestFacadeRector::class => [
__DIR__.'/src/WordPress/QueryTrait.php',
// Its test sets $_SERVER['SCRIPT_FILENAME'] to drive that method;
// going through the facade would stop it reaching the code at all.
__DIR__.'/tests/Unit/WordPress/LaravelServingRequestTest.php',
],
__DIR__.'/tests/Unit/helpers.php',
])
->withPreparedSets(
deadCode: true,
codeQuality: true,
typeDeclarations: true,
privatization: true,
earlyReturn: true,
codingStyle: true,
)
->withPhpSets()
->withSets([
LaravelLevelSetList::UP_TO_LARAVEL_130,
LaravelSetList::LARAVEL_CODE_QUALITY,
LaravelSetList::LARAVEL_COLLECTION,
LaravelSetList::LARAVEL_ARRAY_STR_FUNCTION_TO_STATIC_CALL,
LaravelSetList::LARAVEL_TYPE_DECLARATIONS,
]);