Skip to content

Commit

Permalink
PHPStan 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Jan 16, 2022
1 parent 092a3c4 commit 677345a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 27 deletions.
2 changes: 1 addition & 1 deletion composer.json
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
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
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 comments on commit 677345a

Please sign in to comment.