From 0d38d467b8395a67903a3db2f6bf89e38afc673d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 21 Jan 2022 14:08:16 +0100 Subject: [PATCH] fix DBAL 3.3 stan --- phpstan.neon.dist | 2 +- src/Model/Scope/RootScope.php | 10 ++++++++-- src/Persistence/GenericPlatform.php | 5 ----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 0cb9343bf..f85d3cbda 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -33,7 +33,7 @@ parameters: # for Doctrine DBAL 2.x, remove the support once Doctrine ORM 2.10 is released # see https://github.com/doctrine/orm/issues/8526 - - message: '~^(Call to an undefined method Doctrine\\DBAL\\Driver\\Connection::getWrappedConnection\(\)\.|Call to an undefined method Doctrine\\DBAL\\Connection::createSchemaManager\(\)\.|Call to an undefined static method Doctrine\\DBAL\\Exception::invalidPdoInstance\(\)\.|Call to method (getCreateTableSQL|getClobTypeDeclarationSQL|initializeCommentedDoctrineTypes)\(\) of deprecated class Doctrine\\DBAL\\Platforms\\\w+Platform:\n.+|Anonymous class extends deprecated class Doctrine\\DBAL\\Platforms\\(PostgreSQL94Platform|SQLServer2012Platform):\n.+|Call to deprecated method fetch(|All)\(\) of class Doctrine\\DBAL\\Result:\n.+|Call to deprecated method getSchemaManager\(\) of class Doctrine\\DBAL\\Connection:\n.+|Access to an undefined property Doctrine\\DBAL\\Driver\\PDO\\Connection::\$connection\.|Parameter #1 \$dsn of class Doctrine\\DBAL\\Driver\\PDO\\SQLSrv\\Connection constructor expects string, Doctrine\\DBAL\\Driver\\PDO\\Connection given\.|Method Atk4\\Data\\Persistence\\Sql\\Expression::execute\(\) should return Doctrine\\DBAL\\Result\|PDOStatement but returns bool\.|PHPDoc tag @return contains generic type Doctrine\\DBAL\\Schema\\AbstractSchemaManager but class Doctrine\\DBAL\\Schema\\AbstractSchemaManager is not generic\.|Class Doctrine\\DBAL\\Platforms\\(MySqlPlatform|PostgreSqlPlatform) referenced with incorrect case: Doctrine\\DBAL\\Platforms\\(MySQLPlatform|PostgreSQLPlatform)\.)$~' + message: '~^(Call to an undefined method Doctrine\\DBAL\\Driver\\Connection::getWrappedConnection\(\)\.|Call to an undefined method Doctrine\\DBAL\\Connection::createSchemaManager\(\)\.|Call to an undefined static method Doctrine\\DBAL\\Exception::invalidPdoInstance\(\)\.|Call to method (getCreateTableSQL|getClobTypeDeclarationSQL|initializeCommentedDoctrineTypes)\(\) of deprecated class Doctrine\\DBAL\\Platforms\\\w+Platform:\n.+|Anonymous class extends deprecated class Doctrine\\DBAL\\Platforms\\(PostgreSQL94Platform|SQLServer2012Platform):\n.+|Call to deprecated method fetch(|All)\(\) of class Doctrine\\DBAL\\Result:\n.+|Call to deprecated method getSchemaManager\(\) of class Doctrine\\DBAL\\Connection:\n.+|Call to deprecated method getWrappedConnection\(\) of class Doctrine\\DBAL\\Connection:\n.+getNativeConnection\(\).+|Call to deprecated method getWrappedResourceHandle\(\) of class Doctrine\\DBAL\\Driver\\Mysqli\\Connection:\n.+getNativeConnection\(\).+|Access to an undefined property Doctrine\\DBAL\\Driver\\PDO\\Connection::\$connection\.|Parameter #1 \$dsn of class Doctrine\\DBAL\\Driver\\PDO\\SQLSrv\\Connection constructor expects string, Doctrine\\DBAL\\Driver\\PDO\\Connection given\.|Method Atk4\\Data\\Persistence\\Sql\\Expression::execute\(\) should return Doctrine\\DBAL\\Result\|PDOStatement but returns bool\.|PHPDoc tag @return contains generic type Doctrine\\DBAL\\Schema\\AbstractSchemaManager but class Doctrine\\DBAL\\Schema\\AbstractSchemaManager is not generic\.|Class Doctrine\\DBAL\\Platforms\\(MySqlPlatform|PostgreSqlPlatform) referenced with incorrect case: Doctrine\\DBAL\\Platforms\\(MySQLPlatform|PostgreSQLPlatform)\.)$~' path: '*' # count for DBAL 3.x matched in "src/Persistence/GenericPlatform.php" file count: 40 diff --git a/src/Model/Scope/RootScope.php b/src/Model/Scope/RootScope.php index 0476a02f4..5b7b298b4 100644 --- a/src/Model/Scope/RootScope.php +++ b/src/Model/Scope/RootScope.php @@ -48,12 +48,18 @@ public function negate() throw new Exception('Model Scope cannot be negated!'); } - public static function createAnd(...$conditions) + /** + * @return Model\Scope + */ + public static function createAnd(...$conditions) // @phpstan-ignore-line { return (parent::class)::createAnd(...$conditions); } - public static function createOr(...$conditions) + /** + * @return Model\Scope + */ + public static function createOr(...$conditions) // @phpstan-ignore-line { return (parent::class)::createOr(...$conditions); } diff --git a/src/Persistence/GenericPlatform.php b/src/Persistence/GenericPlatform.php index da6dc4c48..3fe2df090 100644 --- a/src/Persistence/GenericPlatform.php +++ b/src/Persistence/GenericPlatform.php @@ -43,11 +43,6 @@ private function createNotSupportedException(): \Exception $connection->getSchemaManager(); $connection->getSchemaManager(); $connection->getSchemaManager(); - $connection->getSchemaManager(); - $connection->getSchemaManager(); - $connection->getSchemaManager(); - $connection->getSchemaManager(); - $connection->getSchemaManager(); } }