-
Notifications
You must be signed in to change notification settings - Fork 46
/
phpstan.neon.dist
143 lines (133 loc) · 6.88 KB
/
phpstan.neon.dist
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
includes:
- phar://phpstan.phar/conf/bleedingEdge.neon
parameters:
level: 6
checkMissingOverrideMethodAttribute: true
paths:
- .
excludePaths:
- vendor
ignoreErrors:
- '~^Unsafe usage of new static\(\)\.$~'
# relax strict rules
- '~^Only booleans are allowed in .+, .+ given( on the (left|right) side)?\.$~'
- '~^Variable (static )?(property access|method call) on .+\.$~'
# assign to generic callable property is broken https://github.com/phpstan/phpstan/issues/8964
-
path: '*'
identifier: assign.propertyType
message: '~^Property Atk4\\Data\\Model\\UserAction::\$(enabled|preview) .*Closure<.+ does not accept .*Closure\(.+\.$~'
count: 3
# https://github.com/phpstan/phpstan/issues/11718
-
path: 'src/Reference.php'
identifier: argument.type
message: '~^Parameter #1 \$key of method Atk4\\Data\\Reference\\WeakAnalysingMap<array<int, mixed>,Closure,Atk4\\Data\\Model\|Atk4\\Data\\Persistence>::(get|set)\(\) expects list<mixed>, array\{0: Atk4\\Data\\Reference\\WeakAnalysingMap<list<mixed>, Closure, Atk4\\Data\\Model\|Atk4\\Data\\Persistence>, 1: non-falsy-string, 2: class-string<object>\|null, 3\?: object\|null, 4\?: non-empty-array\} given\.$~'
count: 2
# fix https://github.com/phpstan/phpstan-deprecation-rules/issues/52 and https://github.com/phpstan/phpstan/issues/6444
-
path: '*'
identifier: staticMethod.deprecatedClass
message: '~^Call to method (getVarcharTypeDeclarationSQL|getClobTypeDeclarationSQL|getCreateIndexSQL|getCreateTableSQL|getCurrentDatabaseExpression|initializeDoctrineTypeMappings)\(\) of deprecated class Doctrine\\DBAL\\Platforms\\(PostgreSQLPlatform|SQLServerPlatform|AbstractPlatform):\nUse.+instead\.$~'
count: 6
# https://github.com/phpstan/phpstan-deprecation-rules/issues/75
-
path: '*'
identifier: method.deprecated
message: '~^Call to deprecated method getVarcharTypeDeclarationSQL\(\) of class AnonymousClass\w+:\nUse \{@link getStringTypeDeclarationSQL\(\)\} instead\.$~'
count: 1
# AbstractPlatform::getIdentitySequenceName() method is deprecated in DBAL 3.4+,
# in DBAL 4.0 OraclePlatform::getIdentitySequenceName() is protected and
# PostgreSQLPlatform::getIdentitySequenceName() is removed:
# https://github.com/doctrine/dbal/blob/3.5.1/src/Platforms/PostgreSQLPlatform.php#L611
# https://github.com/doctrine/dbal/blob/4.0.0-beta1/src/Platforms/PostgreSQLPlatform.php#L297
-
path: '*'
identifier: method.deprecated
message: '~^Call to deprecated method getIdentitySequenceName\(\) of class Doctrine\\DBAL\\Platforms\\(PostgreSQLPlatform|OraclePlatform)\.$~'
count: 3
# FC for DBAL 4.0, remove once DBAL 3.x support is dropped
-
path: '*'
identifier: class.nameCase
message: '~^Class Doctrine\\DBAL\\(Platforms\\SqlitePlatform|Schema\\SqliteSchemaManager) referenced with incorrect case: Doctrine\\DBAL\\(Platforms\\SQLitePlatform|Schema\\SQLiteSchemaManager)\.$~'
count: 24
# remove once https://github.com/phpstan/phpstan/issues/11488 is fixed
-
path: 'src/Persistence/Sql/Oracle/Query.php'
identifier: nullCoalesce.variable
message: '~^Variable \$operator on left side of \?\? is never defined\.$~'
count: 1
-
path: 'src/Persistence/Sql/Oracle/Query.php'
identifier: instanceof.alwaysFalse
message: '~^Instanceof between \*NEVER\* and Atk4\\Data\\Field will always evaluate to false\.$~'
count: 2
-
path: 'src/Persistence/Sql/Oracle/Query.php'
identifier: booleanAnd.alwaysFalse
message: '~^Result of && is always false\.$~'
count: 3
-
path: 'src/Persistence/Sql/Query.php'
identifier: identical.alwaysFalse
message: '~^Strict comparison using === between \*NEVER\* and 3 will always evaluate to false\.$~'
count: 1
-
path: 'src/Persistence/Sql/Query.php'
identifier: variable.undefined
message: '~^(Undefined variable: \$(operator|value)|Variable \$value might not be defined\.)$~'
count: 3
# TODO these rules are generated, this ignores should be fixed in the code
# for src/Schema/TestCase.php
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Persistence::dsql\(\)\.$~'
# for src/Field/SqlExpressionField.php
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Model::expr\(\)\.$~'
# for src/Model.php
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Persistence::export\(\)\.$~'
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Persistence::prepareIterator\(\)\.$~'
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Persistence::action\(\)\.$~'
# for src/Model/ReferencesTrait.php (in context of class Atk4\Data\Model)
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Reference::refLink\(\)\.$~'
# for src/Persistence/Sql.php
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Persistence::expr\(\)\.$~'
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Persistence::exprNow\(\)\.$~'
# for src/Reference/HasMany.php
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Model::dsql\(\)\.$~'
# for tests/FieldTest.php
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Reference\\HasOne::addTitle\(\)\.$~'
# for tests/JoinSqlTest.php
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Reference\\HasOne::addField\(\)\.$~'
# for tests/ReferenceSqlTest.php
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Reference\\HasOne::addFields\(\)\.$~'
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Reference::addTitle\(\)\.$~'
# for tests/ScopeTest.php
-
identifier: method.notFound
message: '~^Call to an undefined method Atk4\\Data\\Tests\\SUser::expr\(\)\.$~'