]> git.mxchange.org Git - friendica.git/commitdiff
fixups
authorPhilipp <admin@philipp.info>
Sun, 14 May 2023 09:18:59 +0000 (11:18 +0200)
committerPhilipp <admin@philipp.info>
Sun, 14 May 2023 09:18:59 +0000 (11:18 +0200)
src/Database/DBStructure.php
src/Database/DatabaseException.php
src/Federation/Repository/DeliveryQueueItem.php

index 3141ca666bab86c7c379919d8519f352701a5e5d..6291d0ffc4b643a2f32bfbad6f2edb2ca10ff92a 100644 (file)
@@ -58,7 +58,7 @@ class DBStructure
        }
 
        /**
-        * Dops a specific table
+        * Drops a specific table
         *
         * @param string $table the table name
         *
index 9473e58081feaedfd33470c96f33f9c772da1fdc..8c99b9a7ef4a59a26d8af46c4df2ecc6ef29e146 100644 (file)
@@ -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;
        }
 
        /**
index 5d5198adfbb333e519f624adb3e29bfdaad4f2f9..37d4ad84ca05fd17b273655660cf1807a3d9265c 100644 (file)
@@ -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