forked from doctrine/doctrine1
-
Notifications
You must be signed in to change notification settings - Fork 11
/
psalm.xml
268 lines (240 loc) · 14.2 KB
/
psalm.xml
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<?xml version="1.0"?>
<psalm
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config ./vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
errorLevel="2"
findUnusedBaselineEntry="false"
findUnusedCode="false"
>
<projectFiles>
<directory name="./lib/" />
</projectFiles>
<issueHandlers>
<LessSpecificReturnType errorLevel="info" />
<!-- level 3 issues - slightly lazy code writing, but provably low false-negatives -->
<DeprecatedMethod errorLevel="info" />
<DeprecatedProperty errorLevel="info" />
<DeprecatedClass errorLevel="info" />
<DeprecatedInterface errorLevel="info" />
<MissingClosureReturnType errorLevel="info" />
<MissingReturnType errorLevel="info" />
<MissingPropertyType errorLevel="info" />
<InvalidDocblock errorLevel="info" />
<PropertyNotSetInConstructor errorLevel="info" />
<MissingConstructor errorLevel="info" />
<MissingClosureParamType errorLevel="info" />
<MissingParamType errorLevel="info" />
<DocblockTypeContradiction errorLevel="info" />
<RedundantConditionGivenDocblockType errorLevel="info" />
<UnresolvableInclude errorLevel="info" />
<RawObjectIteration errorLevel="info" />
<!-- level 4 issues - points to possible deficiencies in logic, higher false-positives -->
<MoreSpecificReturnType errorLevel="info" />
<LessSpecificReturnStatement errorLevel="info" />
<ArgumentTypeCoercion errorLevel="info" />
<RedundantCondition errorLevel="info" />
<PossiblyFalseArgument errorLevel="info" />
<PossiblyFalseIterator errorLevel="info" />
<PossiblyFalseOperand errorLevel="info" />
<PossiblyFalsePropertyAssignmentValue errorLevel="info" />
<PossiblyFalseReference errorLevel="info" />
<PossiblyInvalidArgument errorLevel="info" />
<PossiblyInvalidArrayAccess errorLevel="info" />
<PossiblyInvalidArrayAssignment errorLevel="info" />
<PossiblyInvalidArrayOffset errorLevel="info" />
<PossiblyInvalidFunctionCall errorLevel="info" />
<PossiblyInvalidIterator errorLevel="info" />
<PossiblyInvalidMethodCall errorLevel="info" />
<PossiblyInvalidOperand errorLevel="info" />
<PossiblyInvalidPropertyAssignment errorLevel="info" />
<PossiblyInvalidPropertyAssignmentValue errorLevel="info" />
<PossiblyInvalidPropertyFetch errorLevel="info" />
<PossiblyNullArgument errorLevel="info" />
<PossiblyNullArrayAccess errorLevel="info" />
<PossiblyNullArrayAssignment errorLevel="info" />
<PossiblyNullArrayOffset errorLevel="info" />
<PossiblyNullFunctionCall errorLevel="info" />
<PossiblyNullIterator errorLevel="info" />
<PossiblyNullOperand errorLevel="info" />
<PossiblyNullPropertyAssignment errorLevel="info" />
<PossiblyNullPropertyAssignmentValue errorLevel="info" />
<PossiblyNullPropertyFetch errorLevel="info" />
<PossiblyNullReference errorLevel="info" />
<PossiblyUndefinedGlobalVariable errorLevel="info" />
<PossiblyUndefinedVariable errorLevel="info" />
<PossiblyUndefinedMethod errorLevel="info" />
<RedundantPropertyInitializationCheck errorLevel="info" />
<RedundantCastGivenDocblockType errorLevel="info" />
<TooManyArguments>
<errorLevel type="info">
<!-- different number of parameters passed depending on the mode -->
<file name="lib/Doctrine/Connection/Statement.php" />
<!-- I think this one is a bug in psalm, it even shows in the code snippet in the console that the
method is only being called with one parameter, not sure why it sees it as 2 -->
<file name="lib/Doctrine/Record.php" />
</errorLevel>
</TooManyArguments>
<TypeDoesNotContainType>
<errorLevel type="info">
<!-- In this case the variable will never be an int, can probably remove the is_int condition, though maybe
needs to be changed to something like is_numeric -->
<file name="lib/Doctrine/Parser/Xml.php" />
</errorLevel>
</TypeDoesNotContainType>
<!-- Doctrine isn't terribly consistent with its inherited/overridden methods -->
<ImplementedReturnTypeMismatch errorLevel="info" />
<!-- These all come from missing extensions, and psalm apparently doesn't load them from stubs files -->
<UndefinedConstant errorLevel="info" />
<EmptyArrayAccess>
<errorLevel type="info">
<!-- This array is built in a do/while loop, so will be empty on first time through -->
<file name="lib/Doctrine/Hydrator/Graph.php" />
<!-- I believe this is broken (isn't covered by tests). Almost seems like $match should come from a preg_match call perhaps -->
<file name="lib/Doctrine/Connection/Pgsql.php" />
</errorLevel>
</EmptyArrayAccess>
<UndefinedVariable>
<errorLevel type="info">
<!-- This variable will be defined on the first iteration of the loop -->
<file name="lib/Doctrine/Connection/UnitOfWork.php" />
</errorLevel>
</UndefinedVariable>
<UndefinedMethod>
<errorLevel type="info">
<!-- No Doctrine_Collection objects define the "expand" method, and no __call implementations that I can see -->
<file name="lib/Doctrine/Collection/Iterator/Expandable.php" />
<!-- getSequenceName does not live on Doctrine_Connection (or any subclasses), but does live on Doctrine_Formatter, don't see a path to it from Doctrine_Connection though -->
<file name="lib/Doctrine/Export/Mssql.php" />
<!-- The getNode() call on the record here should return a Doctrine_Node_NestedSet, not easy to hint that though without breaking up the if condition -->
<file name="lib/Doctrine/Tree/NestedSet.php" />
<!-- Can't hint which validator this is, and Doctrine_Validator_Driver doesn't implement the validate method -->
<file name="lib/Doctrine/Table.php" />
<!-- This should be hinted to Doctrine_Record (since Doctrine_Record_Abstract doesn't define the delete method), would need to pull $this->_invoker to a variable for that though -->
<file name="lib/Doctrine/Template/SoftDelete.php" />
<!-- _connect and lastSquenceId don't exist -->
<file name="lib/Doctrine/Sequence/Db2.php" />
<!-- indexFile does not exist anywhere -->
<file name="lib/Doctrine/Search/Indexer/Dir.php" />
<!-- parseLiteralValue does not exist on Doctrine_Query_Set or its parents, does live on Doctrine_Query_Condition, but not path to that that I can see -->
<file name="lib/Doctrine/Query/Set.php" />
<!-- load method exists in subclasses, but not this base class -->
<file name="lib/Doctrine/Query/Condition.php" />
<!-- parse method exists in subclass, but not this base class -->
<file name="lib/Doctrine/Query/Abstract.php" />
<!-- experimental code, no tests, methods live on Doctrine_Formatter, not Doctrine_Connection -->
<file name="lib/Doctrine/Expression/Mysql.php" />
<!-- experimental code, no tests, methods live on Doctrine_Formatter, not Doctrine_Connection -->
<file name="lib/Doctrine/Expression/Pgsql.php" />
<!-- fixSequenceName lives on Doctrine_Formatter, not on any Doctrine_Connection objects, no path there, not covered by tests -->
<file name="lib/Doctrine/Import/Sqlite.php" />
<!-- getDeleteActions does not exist, not covered by tests -->
<file name="lib/Doctrine/IntegrityMapper.php" />
<!-- setLevel doesn't exist anywhere, updateLevel does, perhaps this is supposed to be updateLevel -->
<file name="lib/Doctrine/Node/NestedSet/PreOrderIterator.php" />
<!-- There are a bunch here due to calls to "getNode" on Doctrine_Record. Since this is NestedSet, these probably return Doctrine_Node_NestedSet, not Doctrine_Node. Could try to hint all of them, but not really worth it -->
<file name="lib/Doctrine/Node/NestedSet.php" />
</errorLevel>
</UndefinedMethod>
<InvalidArrayAssignment>
<errorLevel type="info">
<!-- A count is performed on the data variable, which should prevent getFirst here from returning false -->
<file name="lib/Doctrine/Tree/NestedSet.php" />
</errorLevel>
</InvalidArrayAssignment>
<InvalidArgument>
<errorLevel type="info">
<file name="lib/Doctrine/Adapter/Statement/Oracle.php" />
<file name="lib/Doctrine/Template/Listener/Timestampable.php" />
<file name="lib/Doctrine/Validator/Readonly.php" />
</errorLevel>
</InvalidArgument>
<InvalidReturnType>
<errorLevel type="info">
<!-- Hydration mode not specified, defaults to Doctrine_Collection -->
<file name="lib/Doctrine/View.php" />
<file name="lib/Doctrine/Relation/Association/Self.php" />
<file name="lib/Doctrine/IntegrityMapper.php" />
<file name="lib/Doctrine/Node/NestedSet.php" />
<!-- Hydration mode is specified as HYDRATE_ARRAY, will be an array -->
<file name="lib/Doctrine/Query.php" />
<!-- Cannot be bool, if it is, gets converted to an int -->
<file name="lib/Doctrine/Formatter.php" />
<!-- SimpleXMLElement::asXml returns string|false if filename isn't specified to asXml call, which is the
case here, so "true" won't ever be returned in this case. -->
<file name="lib/Doctrine/Parser/Xml.php" />
</errorLevel>
</InvalidReturnType>
<InvalidReturnStatement>
<errorLevel type="info">
<!-- Hydration mode not specified, defaults to Doctrine_Collection -->
<file name="lib/Doctrine/View.php" />
<file name="lib/Doctrine/Relation/Association/Self.php" />
<file name="lib/Doctrine/IntegrityMapper.php" />
<file name="lib/Doctrine/Node/NestedSet.php" />
<!-- Hydration mode is specified as HYDRATE_ARRAY, will be an array -->
<file name="lib/Doctrine/Query.php" />
<!-- Cannot be bool, if it is, gets converted to an int -->
<file name="lib/Doctrine/Formatter.php" />
<!-- SimpleXMLElement::asXml returns string|false if filename isn't specified to asXml call, which is the
case here, so "true" won't ever be returned in this case. -->
<file name="lib/Doctrine/Parser/Xml.php" />
</errorLevel>
</InvalidReturnStatement>
<MoreSpecificImplementedParamType errorLevel="info" />
<InvalidNullableReturnType>
<errorLevel type="info">
<!-- The prepare method will throw an exception before it'll return null -->
<file name="lib/Doctrine/Connection.php" />
<!-- The migrate method sets $to to an int if it's null via call to getVersion -->
<file name="lib/Doctrine/Migration.php" />
</errorLevel>
</InvalidNullableReturnType>
<NullableReturnStatement>
<errorLevel type="info">
<!-- The migrate method sets $to to an int if it's null via call to getVersion -->
<file name="lib/Doctrine/Migration.php" />
</errorLevel>
</NullableReturnStatement>
<InvalidScalarArgument>
<errorLevel type="info">
<!-- scalar|null is probably fine here, will be coerced to be an array key, or could change the docblock -->
<file name="lib/Doctrine/Validator/ErrorStack.php" />
<!-- This one is odd, Psalm is reporting the line number as "-1", probably worth reporting to psalm
project -->
<file name="lib/Doctrine/Record.php" />
</errorLevel>
</InvalidScalarArgument>
<NoInterfaceProperties>
<errorLevel type="info">
<!-- this is defined as a @property annotation on Doctrine_Adapter_Statement_Interface, probably needs to be
moved to the concrete implementations -->
<file name="lib/Doctrine/Connection/Statement.php" />
</errorLevel>
</NoInterfaceProperties>
<UnevaluatedCode>
<errorLevel type="info">
<!-- psalm is complaining about the return value from `gettype`, but in this case, `gettype` is only
called if the $type parameter is null, so technically the value of $type could be anything -->
<file name="lib/Doctrine/Formatter.php" />
</errorLevel>
</UnevaluatedCode>
<DuplicateArrayKey>
<errorLevel type="info">
<!-- This is correct, but I don't want to remove the key in case the values ever change in Doctrine_Core
I added a comment about it in Doctrine_Manager -->
<file name="lib/Doctrine/Manager.php" />
</errorLevel>
</DuplicateArrayKey>
<!-- newer version of psalm does not like the @property annotations -->
<UndefinedThisPropertyFetch errorLevel="info" />
<UndefinedPropertyFetch errorLevel="info" />
<!-- Psalm complains about this attribute in PHP 8.0 and 8.1, which makes sense, was added in 8.2-->
<UndefinedAttributeClass>
<errorLevel type="info">
<file name="lib/Doctrine/Table.php" />
</errorLevel>
</UndefinedAttributeClass>
</issueHandlers>
</psalm>