From 378630f8a092c9148d802b9662358346af2cef0f Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Mon, 21 Nov 2022 10:56:15 +0100 Subject: [PATCH] Fix psalm issues following doctrine/dbal bump MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/DB/Connection.php | 7 ++++--- lib/private/DB/Migrator.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index 73e0f4b4ac2..3173a65d875 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -124,6 +124,7 @@ class Connection extends \Doctrine\DBAL\Connection { public function connect() { try { if ($this->_conn) { + /** @psalm-suppress InternalMethod */ return parent::connect(); } @@ -291,7 +292,7 @@ class Connection extends \Doctrine\DBAL\Connection { $sql = $this->adapter->fixupStatement($sql); $this->queriesExecuted++; $this->logQueryToFile($sql); - return parent::executeStatement($sql, $params, $types); + return (int)parent::executeStatement($sql, $params, $types); } protected function logQueryToFile(string $sql): void { @@ -390,7 +391,7 @@ class Connection extends \Doctrine\DBAL\Connection { return $insertQb->createNamedParameter($value, $this->getType($value)); }, array_merge($keys, $values)) ); - return $insertQb->execute(); + return $insertQb->executeStatement(); } catch (NotNullConstraintViolationException $e) { throw $e; } catch (ConstraintViolationException $e) { @@ -416,7 +417,7 @@ class Connection extends \Doctrine\DBAL\Connection { } } $updateQb->where($where); - $affected = $updateQb->execute(); + $affected = $updateQb->executeStatement(); if ($affected === 0 && !empty($updatePreconditionValues)) { throw new PreConditionNotMetException(); diff --git a/lib/private/DB/Migrator.php b/lib/private/DB/Migrator.php index 5dc07be1d2b..97d91e1c100 100644 --- a/lib/private/DB/Migrator.php +++ b/lib/private/DB/Migrator.php @@ -41,7 +41,6 @@ use function preg_match; use OCP\EventDispatcher\IEventDispatcher; class Migrator { - /** @var Connection */ protected $connection; @@ -138,6 +137,7 @@ class Migrator { } } + /** @psalm-suppress InternalMethod */ $comparator = new Comparator(); return $comparator->compare($sourceSchema, $targetSchema); } -- 2.39.5