-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
56 lines (49 loc) · 2.07 KB
/
Copy pathrector.php
File metadata and controls
56 lines (49 loc) · 2.07 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
51
52
53
54
55
56
<?php
declare(strict_types=1);
use Rector\CodingStyle\Rector\FuncCall\FunctionFirstClassCallableRector;
use Rector\Config\RectorConfig;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\Php84\Rector\MethodCall\NewMethodCallWithoutParenthesesRector;
use RectorLaravel\Rector\ClassMethod\MakeModelAttributesAndScopesProtectedRector;
use RectorLaravel\Rector\FuncCall\AppToResolveRector;
use RectorLaravel\Set\LaravelSetList;
return RectorConfig::configure()
->withPaths([
__DIR__.'/config',
__DIR__.'/database',
__DIR__.'/src',
__DIR__.'/tests',
])
->withPhpSets()
->withPreparedSets(
deadCode: true,
codeQuality: true,
typeDeclarations: true,
)
->withSets([
LaravelSetList::LARAVEL_CODE_QUALITY,
])
->withSkip([
// The package resolves out of the container with app(), which is the
// convention the rest of the Laravel ecosystem reads.
AppToResolveRector::class,
// HasCustomFields is a trait consumers apply to their own models, and
// whereCustomField is documented public API. The rule assumes a model.
MakeModelAttributesAndScopesProtectedRector::class => [
__DIR__.'/src/Concerns/HasCustomFields.php',
],
// Architecture tests describe namespaces and classes as strings on
// purpose, so the string form is the point rather than an oversight.
StringClassNameToClassConstantRector::class => [
__DIR__.'/tests/ArchTest.php',
],
// Pest test bodies keep the explicit call forms the suite was written
// with, so a style pass never rewrites an assertion out from under it.
FunctionFirstClassCallableRector::class => [
__DIR__.'/tests',
],
// This one rewrites at print time rather than through the rule, so
// Rector attributes no rule to the change and a path scoped skip never
// matches it. Skipping it outright is the only form that holds.
NewMethodCallWithoutParenthesesRector::class,
]);