From: Michael Date: Tue, 3 Sep 2019 03:59:46 +0000 (+0000) Subject: Type hints X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=52d8b618f0ca93da72b0a951938cad54c2a6d725;p=friendica.git Type hints --- diff --git a/src/Model/ItemDeliveryData.php b/src/Model/ItemDeliveryData.php index 5a181eb1b1..7c64427eff 100644 --- a/src/Model/ItemDeliveryData.php +++ b/src/Model/ItemDeliveryData.php @@ -111,7 +111,7 @@ class ItemDeliveryData * @return bool * @throws \Exception */ - public static function incrementQueueCount($item_id, $increment) + public static function incrementQueueCount(int $item_id, int $increment = 1) { return DBA::e('UPDATE `item-delivery-data` SET `queue_count` = `queue_count` + ? WHERE `iid` = ?', $increment, $item_id); } diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index a0bb0d9fa3..87ec7d5a0c 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -55,7 +55,7 @@ class Diaspora * * @param array $contact of the relay contact */ - public static function markRelayForArchival($contact) + public static function markRelayForArchival(array $contact) { if (!empty($contact['contact-type']) && ($contact['contact-type'] == Contact::TYPE_RELAY)) { // This is already the relay contact, we don't need to fetch it @@ -174,7 +174,7 @@ class Diaspora * @return array with the contact * @throws \Exception */ - private static function getRelayContact($server_url, $fields = ['batch', 'id', 'name', 'network', 'protocol', 'archive', 'blocked']) + private static function getRelayContact(string $server_url, array $fields = ['batch', 'id', 'name', 'network', 'protocol', 'archive', 'blocked']) { // Fetch the relay contact $condition = ['uid' => 0, 'nurl' => Strings::normaliseLink($server_url), diff --git a/src/Worker/Delivery.php b/src/Worker/Delivery.php index 3079adecc2..d29ec7c4c8 100644 --- a/src/Worker/Delivery.php +++ b/src/Worker/Delivery.php @@ -211,7 +211,13 @@ class Delivery extends BaseObject return; } - private static function setFailedQueue($cmd, $id) + /** + * Increased the "failed" counter in the item delivery data + * + * @param string $cmd Command + * @param integer $id Item id + */ + private static function setFailedQueue(string $cmd, int $id) { if (!in_array($cmd, [Delivery::POST, Delivery::POKE])) { return;