Browse Source

fix(deps): Use less 3rdparty dependencies

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/12635/head
Joas Schilling 1 year ago
parent
commit
880a3f2573
No known key found for this signature in database GPG Key ID: 74434EFE0D2E2205
  1. 5
      lib/Migration/Version2001Date20170707115443.php
  2. 5
      lib/Migration/Version2001Date20171026134605.php
  3. 3
      lib/Migration/Version2001Date20180103144447.php
  4. 1
      psalm.xml
  5. 2
      tests/psalm-baseline.xml

5
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'));

5
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);

3
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')

1
psalm.xml

@ -32,7 +32,6 @@
<referencedClass name="Doctrine\DBAL\Exception\InvalidFieldNameException" />
<referencedClass name="Doctrine\DBAL\Exception\TableNotFoundException" />
<referencedClass name="Doctrine\DBAL\Exception\UniqueConstraintViolationException" />
<referencedClass name="Doctrine\DBAL\Platforms\PostgreSQLPlatform" />
<referencedClass name="GuzzleHttp\Exception\ClientException" />
<referencedClass name="GuzzleHttp\Exception\ServerException" />
<referencedClass name="GuzzleHttp\Exception\ConnectException" />

2
tests/psalm-baseline.xml

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.23.1@8471a896ccea3526b26d082f4461eeea467f10a4">
<files psalm-version="5.25.0@01a8eb06b9e9cc6cfb6a320bf9fb14331919d505">
<file src="lib/AppInfo/Application.php">
<UndefinedClass>
<code><![CDATA[BeforeTemplateRenderedEvent]]></code>

Loading…
Cancel
Save