forked from doctrine/dbal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpstan.neon.dist
136 lines (116 loc) · 7.42 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
parameters:
level: 7
paths:
- %currentWorkingDirectory%/src
- %currentWorkingDirectory%/tests
treatPhpDocTypesAsCertain: false
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
# legacy remnants from doctrine/common
- '~^Class Doctrine\\Common\\(Collections\\Collection|Persistence\\Proxy) not found\.\z~'
- '~^.+ on an unknown class Doctrine\\Common\\(Collections\\Collection|Persistence\\Proxy)\.\z~'
# may not exist when pdo_sqlsrv is not loaded but PDO is
- '~^Access to undefined constant PDO::SQLSRV_ENCODING_BINARY\.\z~'
# weird class name, represented in stubs as OCI_(Lob|Collection)
- '~unknown class OCI-(Lob|Collection)~'
# https://github.com/phpstan/phpstan/issues/3132
-
message: '~^Call to function in_array\(\) with arguments Doctrine\\DBAL\\Schema\\Column, array<string> and true will always evaluate to false\.$~'
path: %currentWorkingDirectory%/src/Schema/Table.php
# Requires a release of https://github.com/JetBrains/phpstorm-stubs/pull/553
-
message: '~^Call to function assert\(\) with true will always evaluate to true\.$~'
path: %currentWorkingDirectory%/src/Driver/PDO/Connection.php
# Requires a release of https://github.com/JetBrains/phpstorm-stubs/pull/923
-
message: '~^Instanceof between PDOStatement and PDOStatement will always evaluate to true\.$~'
path: %currentWorkingDirectory%/src/Driver/PDO/Connection.php
# Needs Generics
- '~Method Doctrine\\DBAL\\Schema\\SchemaDiff::getNewTablesSortedByDependencies\(\) should return array<Doctrine\\DBAL\\Schema\\Table> but returns array<object>.~'
# https://github.com/phpstan/phpstan/issues/3134
-
message: '~^Call to static method PHPUnit\\Framework\\Assert::assertSame\(\) with Doctrine\\DBAL\\Types\\Type and Doctrine\\DBAL\\Types\\Type will always evaluate to true\.$~'
path: %currentWorkingDirectory%/tests/Types/TypeRegistryTest.php
# https://github.com/phpstan/phpstan-strict-rules/issues/103
-
message: '~^Construct empty\(\) is not allowed. Use more strict comparison\.~'
paths:
- %currentWorkingDirectory%/src/Driver/*/Driver.php
- %currentWorkingDirectory%/src/Driver/AbstractOracleDriver/EasyConnectString.php
- %currentWorkingDirectory%/src/Platforms/*Platform.php
- %currentWorkingDirectory%/src/Schema/*SchemaManager.php
# Fixing the issue may cause a BC break.
-
message: '~^Method Doctrine\\DBAL\\Driver\\Mysqli\\MysqliConnection::lastInsertId\(\) should return string but returns int\|string\.$~'
paths:
- %currentWorkingDirectory%/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php
# In some namespaces, we use array<string,mixed>, some elements of which are actually boolean
-
message: '~^Only booleans are allowed in .*, mixed given~'
paths:
- %currentWorkingDirectory%/src/Driver/*/Driver.php
- %currentWorkingDirectory%/src/Platforms/*Platform.php
- %currentWorkingDirectory%/src/Schema/*SchemaManager.php
# Some APIs use variable method calls internally
-
message: '~^Variable method call on .*~'
paths:
- %currentWorkingDirectory%/src/Schema/AbstractSchemaManager.php
- %currentWorkingDirectory%/src/Schema/Column.php
# https://github.com/phpstan/phpstan/issues/3146
-
message: '~^Only numeric types are allowed in -, int<1, max>\|false given on the left side\.~'
paths:
- %currentWorkingDirectory%/src/Platforms/SQLServer2012Platform.php
# Temporaily suppressed during up-merging an upgrade PHPStan 0.12
- '~^Unable to resolve the template type ExpectedType in call to method static method PHPUnit\\Framework\\Assert::assertInstanceOf\(\)$~'
# Temporaily suppressed during up-merging an upgrade PHPStan 0.12
-
message: '~^Call to an undefined method Doctrine\\DBAL\\Driver::createDatabasePlatformForVersion\(\)\.$~'
path: %currentWorkingDirectory%/tests/Driver/AbstractDriverTest.php
# Temporaily suppressed during up-merging an upgrade to PHPStan 0.12.33
-
message: '~^Parameter #1 \$expected of static method PHPUnit\\Framework\\Assert::assertInstanceOf\(\) expects class-string<Doctrine\\DBAL\\Connection&PHPUnit\\Framework\\MockObject\\MockObject>, class-string<Doctrine\\DBAL\\Connection>&class-string<PHPUnit\\Framework\\MockObject\\MockObject> given\.$~'
path: %currentWorkingDirectory%/tests/DriverManagerTest.php
# Caused by phpdoc annotations intended for Psalm
-
message: '~Unable to resolve the template type T in call to method static method Doctrine\\DBAL\\DriverManager::getConnection\(\)~'
paths:
- %currentWorkingDirectory%/src/Id/TableGenerator.php
- %currentWorkingDirectory%/src/Schema/SqliteSchemaManager.php
- %currentWorkingDirectory%/tests/ConnectionTest.php
- %currentWorkingDirectory%/tests/DriverManagerTest.php
- %currentWorkingDirectory%/tests/Functional/ConnectionTest.php
- %currentWorkingDirectory%/tests/Functional/Driver/PDO/PgSQL/ConnectionTest.php
- %currentWorkingDirectory%/tests/Functional/ExceptionTest.php
- %currentWorkingDirectory%/tests/Functional/PortabilityTest.php
- %currentWorkingDirectory%/tests/Functional/PrimaryReadReplicaConnectionTest.php
- %currentWorkingDirectory%/tests/Functional/Schema/MySQLSchemaManagerTest.php
- %currentWorkingDirectory%/tests/Schema/Synchronizer/SingleDatabaseSynchronizerTest.php
- %currentWorkingDirectory%/tests/TestUtil.php
# Unlike Psalm, PHPStan doesn't understand the shape of the parse_str() return value
-
message: '~^Parameter #1 \$scheme of static method Doctrine\\DBAL\\DriverManager::parseDatabaseUrlScheme\(\) expects string\|null, int\|string\|null given\.$~'
paths:
- %currentWorkingDirectory%/src/DriverManager.php
# Unlike Psalm, PHPStan doesn't understand that $matchesCount cannot be false
-
message: '~^Only numeric types are allowed in pre\-decrement, int\<1, max\>\|false given\.$~'
paths:
- %currentWorkingDirectory%/src/Platforms/SQLServer2012Platform.php
# https://github.com/phpstan/phpstan-phpunit/issues/83
-
message: '~^Only iterables can be unpacked, array<int, mixed>\|false given in argument #1\.$~'
paths:
- %currentWorkingDirectory%/tests/Functional/Platform/DefaultExpressionTest.php
# https://github.com/phpstan/phpstan/issues/4126
-
message: '~^Call to function iterator_to_array\(\) on a separate line has no effect\.$~'
paths:
- %currentWorkingDirectory%/tests/Functional/Connection/FetchTest.php
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon