-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathphpstan.neon.dist
136 lines (119 loc) · 6.19 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: 8
paths:
- src
- tests
treatPhpDocTypesAsCertain: false
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
# Requires a release of https://github.com/JetBrains/phpstorm-stubs/pull/1158
-
message: '~^Strict comparison using === between string and null will always evaluate to false\.$~'
path: %currentWorkingDirectory%/src/Driver/IBMDB2/Connection.php
# 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: tests/Types/TypeRegistryTest.php
# https://github.com/phpstan/phpstan-strict-rules/issues/103
-
message: '~^Construct empty\(\) is not allowed. Use more strict comparison\.~'
paths:
- src/Connections/PrimaryReadReplicaConnection.php
- src/Driver/*/Driver.php
- src/Driver/AbstractOracleDriver/EasyConnectString.php
- src/Platforms/*Platform.php
- src/Schema/*SchemaManager.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:
- src/Driver/*/Driver.php
- src/Platforms/*Platform.php
- src/Schema/*SchemaManager.php
# Some APIs use variable method calls internally
-
message: '~^Variable method call on .*~'
paths:
- src/Schema/Column.php
# TODO: remove this once the support for PHP 7 is dropped
-
message: '~^Strict comparison using !== between int and false will always evaluate to true\.$~'
paths:
- src/Driver/OCI8/Result.php
-
message: '~^Unreachable statement - code above always terminates\.$~'
paths:
- src/Driver/OCI8/Result.php
-
message: '~Method Doctrine\\DBAL\\DriverManager::createDriver\(\) should return Doctrine\\DBAL\\Driver but returns object\.~'
paths:
- src/DriverManager.php
# https://github.com/phpstan/phpstan/issues/4679
-
message: '~^Cannot call method writeTemporary\(\) on OCILob\|null\.$~'
paths:
- src/Driver/OCI8/Statement.php
-
message: '~Method Doctrine\\DBAL\\Driver\\Mysqli\\Result::rowCount\(\) should return int but returns int(:?<0, max>)?\|string\.~'
paths:
- src/Driver/Mysqli/Result.php
# The schema manager isn't initialized if the test is skipped
-
message: '~Strict comparison using === between Doctrine\\DBAL\\Schema\\AbstractSchemaManager and null will always evaluate to false\.~'
path: tests/Functional/Schema/SchemaManagerFunctionalTestCase.php
# Removing the (int) cast will make Psalm unhappy.
-
message: '~^Casting to int something that''s already int\.$~'
paths:
- src/Driver/Mysqli/Exception/ConnectionError.php
- src/Driver/Mysqli/Exception/ConnectionFailed.php
- src/Driver/Mysqli/Exception/InvalidCharset.php
- src/Driver/Mysqli/Exception/StatementError.php
-
message: '~^Unable to resolve the template type T in call to method Doctrine\\DBAL\\Portability\\Converter\:\:compose\(\)$~'
paths:
- src/Portability/Converter.php
# We're testing with invalid input.
-
message: '~^Parameter #2 \$lockMode of method Doctrine\\DBAL\\Platforms\\AbstractPlatform\:\:appendLockHint\(\) expects 0\|1\|2\|4, 128 given\.$~'
path: tests/Platforms/AbstractPlatformTestCase.php
-
message: '~^Unable to resolve the template type T in call to method static method Doctrine\\DBAL\\DriverManager::getConnection\(\)~'
path: tests/DriverManagerTest.php
-
message: '~array{driver: ''invalid_driver''} given\.$~'
path: tests/DriverManagerTest.php
-
message: '~array{url: ''sqlite::memory:'', wrapperClass: ''stdClass''} given\.$~'
path: tests/DriverManagerTest.php
-
message: '~array{driverClass: ''stdClass''} given\.$~'
path: tests/DriverManagerTest.php
# DriverManagerTest::testDatabaseUrl() should be refactored as it's too dynamic.
-
message: '~^Offset string does not exist on array{.+}\.$~'
paths:
- tests/DriverManagerTest.php
# It is not clear how to address these errors (it should be an intersection type)
-
message: '~array{url: ''sqlite::memory:'', wrapperClass: class-string<Doctrine\\DBAL\\Connection>\|class-string<PHPUnit\\Framework\\MockObject\\MockObject>} given\.$~'
path: tests/DriverManagerTest.php
-
message: '~class-string<Doctrine\\DBAL\\Connection>&class-string<PHPUnit\\Framework\\MockObject\\MockObject> given\.$~'
path: tests/DriverManagerTest.php
# It is not clear how to address this error (one of the types is a sub-type of the other)
-
message: '~^Call to static method PHPUnit\\Framework\\Assert::assertSame\(\) .* will always evaluate to false\.$~'
path: tests/ConnectionTest.php
# There is no way to make this assertion in the code,
# and the API doesn't support parametrization of returned column types.
-
message: '~^Method Doctrine\\DBAL\\Schema\\PostgreSQLSchemaManager::fetchTableOptionsByTable\(\) should return array<string, array<string, mixed>> but returns array<int\|string, array<string, mixed>>\.$~'
paths:
- src/Schema/PostgreSQLSchemaManager.php
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon