From 880a3f2573499d4eaeb20cb08a4f2d44e2d3cf66 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 3 Jul 2024 11:37:11 +0200 Subject: [PATCH] fix(deps): Use less 3rdparty dependencies Signed-off-by: Joas Schilling --- lib/Migration/Version2001Date20170707115443.php | 5 ++--- lib/Migration/Version2001Date20171026134605.php | 5 ++--- lib/Migration/Version2001Date20180103144447.php | 3 +-- psalm.xml | 1 - tests/psalm-baseline.xml | 2 +- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/Migration/Version2001Date20170707115443.php b/lib/Migration/Version2001Date20170707115443.php index 5c62760007..8782656acc 100644 --- a/lib/Migration/Version2001Date20170707115443.php +++ b/lib/Migration/Version2001Date20170707115443.php @@ -7,7 +7,6 @@ declare(strict_types=1); */ namespace OCA\Talk\Migration; -use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use OCA\Talk\Participant; use OCA\Talk\Room; use OCP\DB\ISchemaWrapper; @@ -103,7 +102,7 @@ class Version2001Date20170707115443 extends SimpleMigrationStep { protected function makeOne2OneParticipantsOwners(array $one2oneRooms): int { $update = $this->db->getQueryBuilder(); - if (!$this->db->getDatabasePlatform() instanceof PostgreSQLPlatform) { + if ($this->db->getDatabaseProvider() !== IDBConnection::PLATFORM_POSTGRES) { $update->update('spreedme_room_participants') ->set('participantType', $update->createNamedParameter(Participant::OWNER)) ->where($update->expr()->in('roomId', $update->createNamedParameter($one2oneRooms, IQueryBuilder::PARAM_INT_ARRAY))); @@ -123,7 +122,7 @@ class Version2001Date20170707115443 extends SimpleMigrationStep { protected function makeGroupParticipantsModerators(array $one2oneRooms): int { $update = $this->db->getQueryBuilder(); - if (!$this->db->getDatabasePlatform() instanceof PostgreSQLPlatform) { + if ($this->db->getDatabaseProvider() !== IDBConnection::PLATFORM_POSTGRES) { $update->update('spreedme_room_participants') ->set('participantType', $update->createNamedParameter(Participant::MODERATOR)) ->where($update->expr()->nonEmptyString('userId')); diff --git a/lib/Migration/Version2001Date20171026134605.php b/lib/Migration/Version2001Date20171026134605.php index dc5381c254..f32388c8d2 100644 --- a/lib/Migration/Version2001Date20171026134605.php +++ b/lib/Migration/Version2001Date20171026134605.php @@ -9,7 +9,6 @@ namespace OCA\Talk\Migration; use Doctrine\DBAL\Exception\InvalidFieldNameException; use Doctrine\DBAL\Exception\TableNotFoundException; -use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use OCP\DB\ISchemaWrapper; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\DB\Types; @@ -193,7 +192,7 @@ class Version2001Date20171026134605 extends SimpleMigrationStep { */ protected function copyParticipants(array $roomIdMap): void { $insert = $this->connection->getQueryBuilder(); - if (!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) { + if ($this->connection->getDatabaseProvider() !== IDBConnection::PLATFORM_POSTGRES) { $insert->insert('talk_participants') ->values([ 'userId' => $insert->createParameter('userId'), @@ -229,7 +228,7 @@ class Version2001Date20171026134605 extends SimpleMigrationStep { ->setParameter('lastPing', (int) $row['lastPing'], IQueryBuilder::PARAM_INT) ->setParameter('sessionId', $row['sessionId']) ; - if (!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) { + if ($this->connection->getDatabaseProvider() !== IDBConnection::PLATFORM_POSTGRES) { $insert->setParameter('participantType', (int) $row['participantType'], IQueryBuilder::PARAM_INT); } else { $insert->setParameter('participantType', (int) $row['participanttype'], IQueryBuilder::PARAM_INT); diff --git a/lib/Migration/Version2001Date20180103144447.php b/lib/Migration/Version2001Date20180103144447.php index de96d73765..72bab48f04 100644 --- a/lib/Migration/Version2001Date20180103144447.php +++ b/lib/Migration/Version2001Date20180103144447.php @@ -7,7 +7,6 @@ declare(strict_types=1); */ namespace OCA\Talk\Migration; -use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use OCP\DB\ISchemaWrapper; use OCP\DB\Types; use OCP\IConfig; @@ -99,7 +98,7 @@ class Version2001Date20180103144447 extends SimpleMigrationStep { return; } - if (!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) { + if ($this->connection->getDatabaseProvider() !== IDBConnection::PLATFORM_POSTGRES) { $update = $this->connection->getQueryBuilder(); $update->update('talk_rooms') ->set('active_since', 'activeSince') diff --git a/psalm.xml b/psalm.xml index 588f88bfa6..16a43bc40d 100644 --- a/psalm.xml +++ b/psalm.xml @@ -32,7 +32,6 @@ - diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index 54bcce7bd3..cbf0aa799c 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -1,5 +1,5 @@ - +