From 8c2678c82f09131490226de1dc308f5212a7f7c7 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sun, 14 May 2023 11:18:59 +0200 Subject: [PATCH] fixups --- src/Database/DBStructure.php | 2 +- src/Database/DatabaseException.php | 3 +-- .../Repository/DeliveryQueueItem.php | 18 +++++++++++------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php index 3141ca666b..6291d0ffc4 100644 --- a/src/Database/DBStructure.php +++ b/src/Database/DBStructure.php @@ -58,7 +58,7 @@ class DBStructure } /** - * Dops a specific table + * Drops a specific table * * @param string $table the table name * diff --git a/src/Database/DatabaseException.php b/src/Database/DatabaseException.php index 9473e58081..8c99b9a7ef 100644 --- a/src/Database/DatabaseException.php +++ b/src/Database/DatabaseException.php @@ -45,9 +45,8 @@ class DatabaseException extends Exception */ public function __construct(string $message, int $code, string $query, Throwable $previous = null) { - $this->query = $query; - parent::__construct(sprintf('"%s" at "%s"', $message, $query) , $code, $previous); + $this->query = $query; } /** diff --git a/src/Federation/Repository/DeliveryQueueItem.php b/src/Federation/Repository/DeliveryQueueItem.php index 5d5198adfb..37d4ad84ca 100644 --- a/src/Federation/Repository/DeliveryQueueItem.php +++ b/src/Federation/Repository/DeliveryQueueItem.php @@ -88,8 +88,10 @@ final class DeliveryQueueItem extends \Friendica\BaseRepository public function remove(Entity\DeliveryQueueItem $deliveryQueueItem): bool { - return $this->db->delete(self::$table_name, ['uri-id' => $deliveryQueueItem->postUriId, - 'gsid' => $deliveryQueueItem->targetServerId]); + return $this->db->delete(self::$table_name, [ + 'uri-id' => $deliveryQueueItem->postUriId, + 'gsid' => $deliveryQueueItem->targetServerId + ]); } public function removeFailedByServerId(int $gsid, int $failedThreshold): bool @@ -99,11 +101,13 @@ final class DeliveryQueueItem extends \Friendica\BaseRepository public function incrementFailed(Entity\DeliveryQueueItem $deliveryQueueItem): bool { - return $this->db->update(self::$table_name, ["`failed` = `failed` + 1"], - ["`uri-id` = ? AND `gsid` = ?", - $deliveryQueueItem->postUriId, - $deliveryQueueItem->targetServerId - ]); + return $this->db->update(self::$table_name, [ + "`failed` = `failed` + 1" + ], [ + "`uri-id` = ? AND `gsid` = ?", + $deliveryQueueItem->postUriId, + $deliveryQueueItem->targetServerId + ]); } public function optimizeStorage(): bool -- 2.39.5