-
Notifications
You must be signed in to change notification settings - Fork 0
/
rules.neon
120 lines (117 loc) · 4.96 KB
/
rules.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
parameters:
silverstan:
includeTestOnly: false
requireParentCallInOverridenMethod:
enabled: true
classes:
-
class: SilverStripe\ORM\DataObject
method: onAfterWrite
-
class: SilverStripe\ORM\DataObject
method: onBeforeWrite
-
class: SilverStripe\ORM\DataObject
method: requireDefaultRecords
disallowOverridingOfConfigurationPropertyType:
enabled: true
requireConfigurationPropertyOverride:
enabled: true
classes:
-
class: SilverStripe\ORM\DataObject
properties:
- table_name
disallowMethodCallOnUnsafeDataObject:
enabled: true
allowedMethodCalls: []
disallowNewInstanceOnInjectable:
enabled: true
disallowPropertyFetchOnConfigForClass:
enabled: true
disallowPropertyFetchOnUnsafeDataObject:
enabled: true
disallowStaticPropertyFetchOnConfigurationProperty:
enabled: true
parametersSchema:
silverstan: structure([
includeTestOnly: bool()
requireParentCallInOverridenMethod: structure([
enabled: bool()
classes: arrayOf(
structure([
class: string(),
method: string(),
?isFirst: bool()
])
)
])
disallowOverridingOfConfigurationPropertyType: structure([
enabled: bool()
])
requireConfigurationPropertyOverride: structure([
enabled: bool()
classes: arrayOf(
structure([
class: string(),
properties: arrayOf(string())
])
)
])
disallowMethodCallOnUnsafeDataObject: structure([
enabled: bool()
allowedMethodCalls: arrayOf(string())
])
disallowNewInstanceOnInjectable: structure([
enabled: bool()
])
disallowPropertyFetchOnConfigForClass: structure([
enabled: bool()
])
disallowPropertyFetchOnUnsafeDataObject: structure([
enabled: bool()
])
disallowStaticPropertyFetchOnConfigurationProperty: structure([
enabled: bool()
])
])
conditionalTags:
Cambis\Silverstan\Rule\ClassMethod\RequireParentCallInOverridenMethodRule:
phpstan.rules.rule: %silverstan.requireParentCallInOverridenMethod.enabled%
Cambis\Silverstan\Rule\ClassPropertyNode\DisallowOverridingOfConfigurationPropertyTypeRule:
phpstan.rules.rule: %silverstan.disallowOverridingOfConfigurationPropertyType.enabled%
Cambis\Silverstan\Rule\InClassNode\RequireConfigurationPropertyOverrideRule:
phpstan.rules.rule: %silverstan.requireConfigurationPropertyOverride.enabled%
Cambis\Silverstan\Rule\MethodCall\DisallowMethodCallOnUnsafeDataObjectRule:
phpstan.rules.rule: %silverstan.disallowMethodCallOnUnsafeDataObject.enabled%
Cambis\Silverstan\Rule\New_\DisallowNewInstanceOnInjectableRule:
phpstan.rules.rule: %silverstan.disallowNewInstanceOnInjectable.enabled%
Cambis\Silverstan\Rule\PropertyFetch\DisallowPropertyFetchOnConfigForClassRule:
phpstan.rules.rule: %silverstan.disallowPropertyFetchOnConfigForClass.enabled%
Cambis\Silverstan\Rule\PropertyFetch\DisallowPropertyFetchOnUnsafeDataObjectRule:
phpstan.rules.rule: %silverstan.disallowPropertyFetchOnUnsafeDataObject.enabled%
Cambis\Silverstan\Rule\StaticPropertyFetch\DisallowStaticPropertyFetchOnConfigurationPropertyRule:
phpstan.rules.rule: %silverstan.disallowStaticPropertyFetchOnConfigurationProperty.enabled%
services:
-
class: Cambis\Silverstan\Rule\ClassMethod\RequireParentCallInOverridenMethodRule
arguments:
classes: %silverstan.requireParentCallInOverridenMethod.classes%
-
class: Cambis\Silverstan\Rule\ClassPropertyNode\DisallowOverridingOfConfigurationPropertyTypeRule
-
class: Cambis\Silverstan\Rule\InClassNode\RequireConfigurationPropertyOverrideRule
arguments:
classes: %silverstan.requireConfigurationPropertyOverride.classes%
-
class: Cambis\Silverstan\Rule\MethodCall\DisallowMethodCallOnUnsafeDataObjectRule
arguments:
allowedMethodCalls: %silverstan.disallowMethodCallOnUnsafeDataObject.allowedMethodCalls%
-
class: Cambis\Silverstan\Rule\New_\DisallowNewInstanceOnInjectableRule
-
class: Cambis\Silverstan\Rule\PropertyFetch\DisallowPropertyFetchOnConfigForClassRule
-
class: Cambis\Silverstan\Rule\PropertyFetch\DisallowPropertyFetchOnUnsafeDataObjectRule
-
class: Cambis\Silverstan\Rule\StaticPropertyFetch\DisallowStaticPropertyFetchOnConfigurationPropertyRule