diff --git a/composer.json b/composer.json index 327ec917913..0e7a7fa6299 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "require-dev": { "doctrine/coding-standard": "9.0.0", "jetbrains/phpstorm-stubs": "2021.1", - "phpstan/phpstan": "1.3.0", + "phpstan/phpstan": "1.4.0", "phpunit/phpunit": "^7.5.20|^8.5|9.5.11", "psalm/plugin-phpunit": "0.16.1", "squizlabs/php_codesniffer": "3.6.2", diff --git a/lib/Doctrine/DBAL/Types/Type.php b/lib/Doctrine/DBAL/Types/Type.php index 64e59fec068..57b05e0cf2f 100644 --- a/lib/Doctrine/DBAL/Types/Type.php +++ b/lib/Doctrine/DBAL/Types/Type.php @@ -296,7 +296,7 @@ public function getBindingType() * Gets the types array map which holds all registered types and the corresponding * type class * - * @return string[] + * @return array */ public static function getTypesMap() { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 53a1f156824..8582307b6b0 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -75,12 +75,6 @@ parameters: paths: - lib/Doctrine/DBAL/Portability/Connection.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: - - lib/Doctrine/DBAL/DriverManager.php - # Until 3.x, $_conn does accept PDO - message: '~^Property Doctrine\\DBAL\\Connection::\$_conn \(Doctrine\\DBAL\\Driver\\Connection\|null\) does not accept PDO\.$~' @@ -115,7 +109,19 @@ parameters: paths: - lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php + # This is a new requirement for PHP7's oci8 extension that prevents bound values from being garbage collected. + - + message: '~^Property Doctrine\\DBAL\\Driver\\OCI8\\OCI8Statement\:\:\$boundValues is never read, only written\.$~' + paths: + - lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php + - message: '~Method Doctrine\\DBAL\\Driver\\Mysqli\\MysqliStatement::rowCount\(\) should return int but returns int\|string\.~' paths: - lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php + + # TODO: This class is deprecaed, remove this rule on 3.x + - + message: '~^Parameter #2 \$code of class RuntimeException constructor expects int, string given\.$~' + paths: + - lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php