* @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);
}
*
* @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
* @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),
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;