Skip to content

Commit

Permalink
Merge 3.1.x into 3.2.x
Browse files Browse the repository at this point in the history
* 3.1.x:
  Cleanup ignored PHPStan errors
  #4886 Fixed calling `AbstractPlatform::getAdvancedForeignKeyOptionsSQL` triggers a deprecation
  Add missing upcast
  • Loading branch information
derrabus committed Oct 20, 2021
2 parents 9305968 + 92998a7 commit 99df446
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ parameters:
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
# removing it would be BC break
- '~^Constructor of class Doctrine\\DBAL\\Schema\\Table has an unused parameter \$idGeneratorType\.\z~'

# changing these would be a BC break, to be done in next major
- "~^Casting to bool something that's already bool.~"
- '~^Property Doctrine\\DBAL\\Schema\\Schema::\$_schemaConfig \(Doctrine\\DBAL\\Schema\\SchemaConfig\) does not accept default value of type false\.\z~'
- '~^Return type \(int\|false\) of method Doctrine\\DBAL\\Driver\\OCI8\\Connection\:\:lastInsertId\(\) should be compatible with return type \(string\) of method Doctrine\\DBAL\\Driver\\Connection::lastInsertId\(\)~'
- '~^Method Doctrine\\DBAL\\Driver\\Mysqli\\Connection::lastInsertId\(\) should return string but returns int\|string\.$~'

Expand All @@ -27,10 +22,6 @@ parameters:
- '~^Class Doctrine\\Common\\(Collections\\Collection|Persistence\\Proxy) not found\.\z~'
- '~^.+ on an unknown class Doctrine\\Common\\(Collections\\Collection|Persistence\\Proxy)\.\z~'

# weird class name, represented in stubs as OCI_(Lob|Collection)
- '~unknown class OCI-(Lob|Collection)~'
- '~^Call to method writetemporary\(\) on an unknown class OCILob\.~'

# Requires a release of https://github.com/JetBrains/phpstorm-stubs/pull/553
-
message: '~^Call to function assert\(\) with true will always evaluate to true\.$~'
Expand All @@ -41,9 +32,6 @@ parameters:
message: '~^Instanceof between PDOStatement and PDOStatement will always evaluate to true\.$~'
path: 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\.$~'
Expand All @@ -58,12 +46,6 @@ parameters:
- src/Platforms/*Platform.php
- src/Schema/*SchemaManager.php

# Fixing the issue may cause a BC break.
-
message: '~^Method Doctrine\\DBAL\\Driver\\Mysqli\\Connection::lastInsertId\(\) should return string but returns int\|string\.$~'
paths:
- src/Driver/Mysqli/Connection.php

# In some namespaces, we use array<string,mixed>, some elements of which are actually boolean
-
message: '~^Only booleans are allowed in .*, mixed given~'
Expand All @@ -79,30 +61,12 @@ parameters:
paths:
- 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:
- src/Platforms/SQLServerPlatform.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

# 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:
- src/Platforms/SQLServerPlatform.php

# https://github.com/phpstan/phpstan-phpunit/issues/83
-
message: '~^Only iterables can be unpacked, array<int, mixed>\|false given in argument #1\.$~'
paths:
- tests/Functional/Platform/DefaultExpressionTest.php

-
message: '~^Instanceof between Doctrine\\DBAL\\Platforms\\Keywords\\KeywordList and Doctrine\\DBAL\\Platforms\\Keywords\\KeywordList will always evaluate to true\.~'
paths:
Expand All @@ -117,17 +81,6 @@ parameters:
message: '~^Unreachable statement - code above always terminates\.$~'
paths:
- src/Driver/OCI8/Result.php
-
message: '~^Call to function assert\(\) with true will always evaluate to true\.$~'
paths:
- src/Driver/OCI8/Statement.php
-
message: '~^Strict comparison using !== between OCILob\|null and false will always evaluate to true\.$~'
paths:
- src/Driver/OCI8/Statement.php

# This class has been added in PHP 8.1
- '/^Attribute class ReturnTypeWillChange does not exist\.$/'

# https://github.com/phpstan/phpstan/issues/5608
-
Expand All @@ -150,12 +103,6 @@ parameters:
- src/Schema/Comparator.php
- src/Schema/Schema.php

# We're checking for invalid invalid input
-
message: "#^Strict comparison using \\!\\=\\= between null and null will always evaluate to false\\.$#"
count: 1
path: src/Cache/QueryCacheProfile.php

# https://github.com/phpstan/phpstan/issues/1901
-
message: '~^Method Doctrine\\DBAL\\Platforms\\AbstractPlatform::escapeStringForLike\(\) should return string but returns string\|null\.$~'
Expand Down

0 comments on commit 99df446

Please sign in to comment.