-
-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathphpstan.neon
More file actions
220 lines (183 loc) · 6.85 KB
/
Copy pathphpstan.neon
File metadata and controls
220 lines (183 loc) · 6.85 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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
parameters:
level: 8
paths:
- src
- tests/types
excludePaths:
- src/compatibility-intf.php
fileExtensions:
- php
- phtml
ignoreErrors:
# === General ===
# Intentional pattern for factory methods and fluent interfaces
-
identifier: new.static
# === Application ===
# PresenterFactory: defensive type checks after regex validation — always true but kept for safety
-
path: src/Application/PresenterFactory.php
identifiers:
- function.alreadyNarrowedType
- identical.alwaysTrue
- booleanAnd.alwaysTrue
# PresenterFactory: default factory `new $class` yields object; $class is a validated class-string<IPresenter> at the call site
-
identifier: return.type
count: 1
path: src/Application/PresenterFactory.php
# CliRouter intentionally collects extra positional CLI args under int keys
-
identifier: return.type
path: src/Application/Routers/CliRouter.php
# Route/RouteList: defensive type checks — always true after prior validation
-
identifier: function.alreadyNarrowedType
paths:
- src/Application/Routers/Route.php
- src/Application/Routers/RouteList.php
-
identifier: nullCoalesce.offset
path: src/Application/Routers/Route.php
# parse_str() native type is wider than actual query string result
-
identifier: varTag.nativeType
path: src/Application/LinkGenerator.php
# MicroPresenter uses duck typing for template objects and nullable container
-
path: src/Application/MicroPresenter.php
identifiers:
- argument.type
- argument.templateType
- method.notFound
- method.nonObject
- property.notFound
# ErrorPresenter: $code is used in the required template file
-
identifier: closure.unusedUse
path: src/Application/ErrorPresenter.php
# BadRequestException intentionally narrows inherited Exception::$code to int (HTTP status codes only)
-
identifier: property.phpDocType
path: src/Application/exceptions.php
# Presenter readonly properties are assigned via injectPrimary() - intentional Nette DI pattern
-
identifier: property.uninitializedReadonly
path: src/Application/UI/Presenter.php
-
identifier: property.readOnlyAssignNotInConstructor
path: src/Application/UI/Presenter.php
# Presenter::detectedCsrf() redirect() throws AbortException, not InvalidLinkException
-
identifier: catch.neverThrown
path: src/Application/UI/Presenter.php
# run(): $response is guaranteed non-null after the VoidResponse guard; PHPStan re-widens the private property to ?Response after onShutdown/shutdown() calls, but the property can only be set via sendResponse() (non-null Response)
-
identifier: return.type
message: '#should return Nette\\Application\\Response but returns Nette\\Application\\Response\|null\.$#'
count: 1
path: src/Application/UI/Presenter.php
# Nette Forms compatibility - methods differ between versions
-
identifier: method.notFound
path: src/Application/UI/Form.php
# Control::$template->flashes is set dynamically for flash messages
-
identifier: property.notFound
path: src/Application/UI/Control.php
# TemplateFactory::createTemplate() accepts optional $class parameter via phpDoc
-
identifier: arguments.count
paths:
- src/Application/UI/Presenter.php
- src/Application/UI/Control.php
# ComponentReflection: cache reference pattern causes always-true/unreachable false positives
-
path: src/Application/UI/ComponentReflection.php
identifiers:
- notIdentical.alwaysTrue
- deadCode.unreachable
- booleanAnd.rightAlwaysTrue
# ComponentReflection: static methods exist on Presenter subclass, called via $class:: dynamic dispatch
-
path: src/Application/UI/ComponentReflection.php
identifiers:
- staticMethod.notFound
- method.notFound
- return.type
# === Bridges ===
# Nette DI config access pattern - $config is array|object depending on DI version
-
identifier: property.nonObject
path: src/Bridges/ApplicationDI/ApplicationExtension.php
# DI extensions use Definition::addSetup()/getResultDefinition() from ServiceDefinition subclass
-
identifier: method.notFound
paths:
- src/Bridges/ApplicationDI/ApplicationExtension.php
- src/Bridges/ApplicationDI/LatteExtension.php
# Tracy version_compare conditions and BlueScreen closure parameter counts
-
path: src/Bridges/ApplicationDI/ApplicationExtension.php
identifiers:
- booleanAnd.rightAlwaysTrue
- booleanAnd.leftAlwaysTrue
- arguments.count
# NNonceNode has no child nodes; empty by-reference generators require the `false && yield` idiom (same as Latte's NopNode)
-
path: src/Bridges/ApplicationLatte/Nodes/NNonceNode.php
identifiers:
- generator.valueType
- booleanAnd.leftAlwaysFalse
# n:snippet is always placed on a paired element, so its content is never null
-
identifier: argument.type
message: '#\$inner of method .*SnippetNode::printContent\(\) expects .*AreaNode, .*AreaNode\|null given#'
count: 1
path: src/Bridges/ApplicationLatte/Nodes/SnippetNode.php
# enter()/leave() keep the stack balanced, so it is never empty when leave() pops during snippet rendering
-
identifier: offsetAccess.nonArray
count: 1
path: src/Bridges/ApplicationLatte/SnippetRuntime.php
# render() is a control convention method not declared in any interface/base class (duck typing)
-
identifier: method.notFound
message: '#Call to an undefined method .*Control::render\(\)#'
count: 1
path: src/Bridges/ApplicationLatte/SnippetRuntime.php
# a rendered snippet block always has at least one render function, so reset() never returns false
-
identifier: callable.nonCallable
count: 1
path: src/Bridges/ApplicationLatte/SnippetRuntime.php
# UIExtension: Latte filters/functions have varying callable signatures
-
identifier: missingType.callable
path: src/Bridges/ApplicationLatte/UIExtension.php
# Latte filter/function callbacks have variable signatures defined by user
-
identifier: missingType.callable
path: src/Bridges/ApplicationLatte/Template.php
# RoutingPanel uses Closure::bindTo to access private methods of RouteList
-
identifier: method.notFound
path: src/Bridges/ApplicationTracy/RoutingPanel.php
# RoutingPanel::analyse() return type and ReflectionClass with runtime class-string
-
path: src/Bridges/ApplicationTracy/RoutingPanel.php
identifier: return.type
# Tracy routing panel/tab: compiled Latte templates with runtime-dynamic state
-
path: src/Bridges/ApplicationTracy/dist/panel.phtml
identifiers:
- argument.type
- offsetAccess.notFound
- closure.unusedUse
- identical.alwaysFalse
# Tracy routing agent panel: compiled Latte template with recursive block array (self-referencing $_blocks)
-
path: src/Bridges/ApplicationTracy/dist/panel.agent.phtml
identifiers:
- offsetAccess.notFound
- closure.unusedUse