diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2022-11-22 15:48:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 15:48:58 +0100 |
commit | 603feb98f24c92992da025255b0e125ad9d169ba (patch) | |
tree | 6baee3ccd46455e47f12f9f3c91a72ce70253554 /lib | |
parent | ba9059b497d7861a77377066d08137b68d455d34 (diff) | |
parent | beaa81e420559396d1d8245a412af9427afd4e77 (diff) | |
download | nextcloud-server-603feb98f24c92992da025255b0e125ad9d169ba.tar.gz nextcloud-server-603feb98f24c92992da025255b0e125ad9d169ba.zip |
Merge pull request #35234 from nextcloud/fix/bump-doctrine/dbal-to-3.3-in-master
Bump doctrine/dbal to 3.3 in master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/DB/Connection.php | 13 | ||||
-rw-r--r-- | lib/private/DB/Migrator.php | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index 73e0f4b4ac2..ceaffbcfa9a 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -50,12 +50,13 @@ use Doctrine\DBAL\Result; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Statement; use OCP\DB\QueryBuilder\IQueryBuilder; +use OCP\Diagnostics\IEventLogger; use OCP\IRequestId; use OCP\PreConditionNotMetException; +use OCP\Profiler\IProfiler; use OC\DB\QueryBuilder\QueryBuilder; use OC\SystemConfig; use Psr\Log\LoggerInterface; -use OCP\Profiler\IProfiler; class Connection extends \Doctrine\DBAL\Connection { /** @var string */ @@ -124,12 +125,14 @@ class Connection extends \Doctrine\DBAL\Connection { public function connect() { try { if ($this->_conn) { + /** @psalm-suppress InternalMethod */ return parent::connect(); } // Only trigger the event logger for the initial connect call - $eventLogger = \OC::$server->getEventLogger(); + $eventLogger = \OC::$server->get(IEventLogger::class); $eventLogger->start('connect:db', 'db connection opened'); + /** @psalm-suppress InternalMethod */ $status = parent::connect(); $eventLogger->end('connect:db'); @@ -291,7 +294,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 +393,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 +419,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); } |