Skip to content

Commit 6aff1ac

Browse files
authored
Merge pull request #5179 from derrabus/bump/phpstan-on-3.2
PHPStan 1.4.0
2 parents 092a3c4 + 677345a commit 6aff1ac

File tree

3 files changed

+11
-27
lines changed

3 files changed

+11
-27
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"require-dev": {
4343
"doctrine/coding-standard": "9.0.0",
4444
"jetbrains/phpstorm-stubs": "2021.1",
45-
"phpstan/phpstan": "1.3.0",
45+
"phpstan/phpstan": "1.4.0",
4646
"phpstan/phpstan-strict-rules": "^1.1",
4747
"phpunit/phpunit": "9.5.11",
4848
"psalm/plugin-phpunit": "0.16.1",

phpstan.neon.dist

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ parameters:
1818
- '~^Class Doctrine\\Common\\(Collections\\Collection|Persistence\\Proxy) not found\.\z~'
1919
- '~^.+ on an unknown class Doctrine\\Common\\(Collections\\Collection|Persistence\\Proxy)\.\z~'
2020

21-
# Requires a release of https://github.com/JetBrains/phpstorm-stubs/pull/553
22-
-
23-
message: '~^Call to function assert\(\) with true will always evaluate to true\.$~'
24-
path: src/Driver/PDO/Connection.php
25-
26-
# Requires a release of https://github.com/JetBrains/phpstorm-stubs/pull/923
27-
-
28-
message: '~^Instanceof between PDOStatement and PDOStatement will always evaluate to true\.$~'
29-
path: src/Driver/PDO/Connection.php
30-
3121
# https://github.com/phpstan/phpstan/issues/3134
3222
-
3323
message: '~^Call to static method PHPUnit\\Framework\\Assert::assertSame\(\) with Doctrine\\DBAL\\Types\\Type and Doctrine\\DBAL\\Types\\Type will always evaluate to true\.$~'
@@ -57,12 +47,6 @@ parameters:
5747
paths:
5848
- src/Schema/Column.php
5949

60-
# Unlike Psalm, PHPStan doesn't understand the shape of the parse_str() return value
61-
-
62-
message: '~^Parameter #1 \$scheme of static method Doctrine\\DBAL\\DriverManager::parseDatabaseUrlScheme\(\) expects string\|null, int\|string\|null given\.$~'
63-
paths:
64-
- src/DriverManager.php
65-
6650
-
6751
message: '~^Instanceof between Doctrine\\DBAL\\Platforms\\Keywords\\KeywordList and Doctrine\\DBAL\\Platforms\\Keywords\\KeywordList will always evaluate to true\.~'
6852
paths:
@@ -126,24 +110,24 @@ parameters:
126110
message: '~Only numeric types are allowed in \-, float\|null given on the right side\.~'
127111
path: src/Logging/DebugStack.php
128112

129-
# https://github.com/phpstan/phpstan-src/pull/731
130-
-
131-
message: '~Parameter #1 \$array of function array_column expects array, array\|false given\.~'
132-
path: src/Driver/Mysqli/Result.php
133-
134113
-
135114
message: '~Method Doctrine\\DBAL\\Driver\\Mysqli\\Result::rowCount\(\) should return int but returns int(:?<0, max>)?\|string\.~'
136115
paths:
137116
- src/Driver/Mysqli/Result.php
138117

118+
# Removing the (int) cast will make Psalm unhappy.
139119
-
140-
message: '~Method Doctrine\\DBAL\\Driver\\Mysqli\\Connection::exec\(\) should return int but returns int\|string\.~'
120+
message: '~^Casting to int something that''s already int\.$~'
141121
paths:
142-
- src/Driver/Mysqli/Connection.php
122+
- src/Driver/Mysqli/Exception/ConnectionError.php
123+
- src/Driver/Mysqli/Exception/ConnectionFailed.php
124+
- src/Driver/Mysqli/Exception/InvalidCharset.php
125+
- src/Driver/Mysqli/Exception/StatementError.php
143126

144127
-
145-
message: '~^Parameter #1 \$message of class Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\ConnectionFailed constructor expects string, string\|null given\.$~'
128+
message: '~^Unable to resolve the template type T in call to method Doctrine\\DBAL\\Portability\\Converter\:\:compose\(\)$~'
146129
paths:
147-
- src/Driver/Mysqli/Exception/ConnectionFailed.php
130+
- src/Portability/Converter.php
131+
148132
includes:
149133
- vendor/phpstan/phpstan-strict-rules/rules.neon

src/Types/Type.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function getBindingType()
202202
* Gets the types array map which holds all registered types and the corresponding
203203
* type class
204204
*
205-
* @return string[]
205+
* @return array<string, string>
206206
*/
207207
public static function getTypesMap()
208208
{

0 commit comments

Comments
 (0)