diff --git a/3rdparty b/3rdparty index 02ba5bba999b6..fc9d6ab7f2e99 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit 02ba5bba999b61d40c79a6ed56683b69edf66619 +Subproject commit fc9d6ab7f2e990ebb09a9c322db6930a0a27444a diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index 73e0f4b4ac251..ceaffbcfa9a70 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -50,12 +50,13 @@ 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 @@ public function __construct( 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 @@ public function executeStatement($sql, array $params = [], array $types = []): i $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 @@ public function setValues($table, array $keys, array $values, array $updatePreco 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 @@ public function setValues($table, array $keys, array $values, array $updatePreco } } $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 5dc07be1d2b26..97d91e1c1003a 100644 --- a/lib/private/DB/Migrator.php +++ b/lib/private/DB/Migrator.php @@ -41,7 +41,6 @@ use OCP\EventDispatcher\IEventDispatcher; class Migrator { - /** @var Connection */ protected $connection; @@ -138,6 +137,7 @@ protected function getDiff(Schema $targetSchema, Connection $connection) { } } + /** @psalm-suppress InternalMethod */ $comparator = new Comparator(); return $comparator->compare($sourceSchema, $targetSchema); }