-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlarastan.neon
93 lines (89 loc) · 2.99 KB
/
larastan.neon
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
includes:
- ./phpstan.neon
- ../../larastan/larastan/extension.neon
- ../../canvural/larastan-strict-rules/rules.neon
parameters:
larastanStrictRules:
allRules: false
noFacade: true
noValidationInController: true
scopeShouldReturnQueryBuilder: true
noPropertyAccessor: true
noGlobalLaravelFunction: true
allowedGlobalFunctions:
- class_basename
- class_uses_recursive
- e
- env
- object_get
- preg_replace_array
- retry
- str
- tap
- throw_if
- throw_unless
- trait_uses_recursive
- with
- collect
- data_fill
- data_get
- data_set
- value
- config
- fake
- method_field
- now
- old
- redirect
- response
- route
- trans
- trans_choice
- __
- view
- url
- secure_url
- asset
- secure_asset
worksomeLaravel:
allRules: true
disallowEnvironmentChecks: %worksomeLaravel.allRules%
enforceKebabCaseArtisanCommands: %worksomeLaravel.allRules%
requireWithoutTimestamps: %worksomeLaravel.allRules%
namespaceAndSuffix:
App\Events: Event
App\Listener: Listener
App\Policies: Policy
App\Jobs: Job
disallowedMethodCalls:
-
method: 'Illuminate\Routing\Router::resource()'
message: 'usage of [resource] method for routes is disallowed. Please split the resource into multiple routes.'
-
method: 'Illuminate\Routing\Router::apiResource()'
message: 'usage of [apiResource] method for routes is disallowed. Please split the resource into multiple routes.'
ignoreErrors:
-
identifier: missingType.iterableValue
reportUnmatched: false
parametersSchema:
worksomeLaravel: structure([
allRules: anyOf(bool(), arrayOf(bool())),
disallowEnvironmentChecks: anyOf(bool(), arrayOf(bool())),
enforceKebabCaseArtisanCommands: anyOf(bool(), arrayOf(bool())),
requireWithoutTimestamps: anyOf(bool(), arrayOf(bool())),
])
services:
-
class: Worksome\CodingStyle\PHPStan\Laravel\DisallowEnvironmentCheck\DisallowEnvironmentCheckRule
-
class: Worksome\CodingStyle\PHPStan\Laravel\EnforceKebabCaseArtisanCommandsRule
-
class: Worksome\CodingStyle\PHPStan\Laravel\Migrations\RequireWithoutTimestampsRule
conditionalTags:
Worksome\CodingStyle\PHPStan\Laravel\DisallowEnvironmentCheck\DisallowEnvironmentCheckRule:
phpstan.rules.rule: %worksomeLaravel.disallowEnvironmentChecks%
Worksome\CodingStyle\PHPStan\Laravel\EnforceKebabCaseArtisanCommandsRule:
phpstan.rules.rule: %worksomeLaravel.enforceKebabCaseArtisanCommands%
Worksome\CodingStyle\PHPStan\Laravel\Migrations\RequireWithoutTimestampsRule:
phpstan.rules.rule: %worksomeLaravel.requireWithoutTimestamps%