8000 PHPStan 1.4.0 by derrabus · Pull Request #5179 · doctrine/dbal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PHPStan 1.4.0 #5179

8000 New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"require-dev": {
"doctrine/coding-standard": "9.0.0",
"jetbrains/phpstorm-stubs": "2021.1",
"phpstan/phpstan": "1.3.0",
"phpstan/phpstan": "1.4.0",
"phpstan/phpstan-strict-rules": "^1.1",
"phpunit/phpunit": "9.5.11",
"psalm/plugin-phpunit": "0.16.1",
Expand Down
34 changes: 9 additions & 25 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ parameters:
- '~^Class Doctrine\\Common\\(Collections\\Collection|Persistence\\Proxy) not found\.\z~'
- '~^.+ on an unknown class Doctrine\\Common\\(Collections\\Collection|Persistence\\Proxy)\.\z~'

# 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: 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: src/Driver/PDO/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\.$~'
Expand Down Expand Up @@ -57,12 +47,6 @@ parameters:
paths:
- src/Schema/Column.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:
- src/DriverManager.php

-
message: '~^Instanceof between Doctrine\\DBAL\\Platforms\\Keywords\\KeywordList and Doctrine\\DBAL\\Platforms\\Keywords\\KeywordList will always evaluate to true\.~'
paths:
Expand Down Expand Up @@ -126,24 +110,24 @@ parameters:
message: '~Only numeric types are allowed in \-, float\|null given on the right side\.~'
path: src/Logging/DebugStack.php

# https://github.com/phpstan/phpstan-src/pull/731
-
message: '~Parameter #1 \$array of function array_column expects array, array\|false given\.~'
path: src/Driver/Mysqli/Result.php

-
message: '~Method Doctrine\\DBAL\\Driver\\Mysqli\\Result::rowCount\(\) should return int but returns int(:?<0, max>)?\|string\.~'
paths:
- src/Driver/Mysqli/Result.php

# Removing the (int) cast will make Psalm unhappy.
-
message: '~Method Doctrine\\DBAL\\Driver\\Mysqli\\Connection::exec\(\) should return int but returns int\|string\.~'
message: '~^Casting to int something that''s already int\.$~'
paths:
- src/Driver/Mysqli/Connection.php
- 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: '~^Parameter #1 \$message of class Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\ConnectionFailed constructor expects string, string\|null given\.$~'
message: '~^Unable to resolve the template type T in call to method Doctrine\\DBAL\\Portability\\Converter\:\:compose\(\)$~'
paths:
- src/Driver/Mysqli/Exception/ConnectionFailed.php
- src/Portability/Converter.php

includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
2 changes: 1 addition & 1 deletion src/Types/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function getBindingType()
* Gets the types array map which holds all registered types and the corresponding
* type class
*
* @return string[]
* @return array<string, string>
*/
public static function getTypesMap()
{
Expand Down
0