summaryrefslogtreecommitdiffstats
path: root/50.patch
blob: a1c51009055f006be20442e247eb7abc491ee027 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From e50e94da5e23a9d33ef3959c4d1239eec2b1a907 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Tue, 24 Oct 2017 12:40:39 +0200
Subject: [PATCH] fix warning 'Parameter must be an array or an object that
 implements Countable' (PHP 7.2)

---
 src/PubSubHubbub/Model/Subscription.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/PubSubHubbub/Model/Subscription.php b/src/PubSubHubbub/Model/Subscription.php
index 97333ffe..9780b6a8 100644
--- a/src/PubSubHubbub/Model/Subscription.php
+++ b/src/PubSubHubbub/Model/Subscription.php
@@ -71,7 +71,7 @@ public function getSubscription($key)
                 .' of "' . $key . '" must be a non-empty string');
         }
         $result = $this->db->select(['id' => $key]);
-        if (count($result)) {
+        if ($result && count($result)) {
             return $result->current()->getArrayCopy();
         }
         return false;
@@ -91,7 +91,7 @@ public function hasSubscription($key)
                 .' of "' . $key . '" must be a non-empty string');
         }
         $result = $this->db->select(['id' => $key]);
-        if (count($result)) {
+        if ($result && count($result)) {
             return true;
         }
         return false;
@@ -106,7 +106,7 @@ public function hasSubscription($key)
     public function deleteSubscription($key)
     {
         $result = $this->db->select(['id' => $key]);
-        if (count($result)) {
+        if ($result && count($result)) {
             $this->db->delete(
                 ['id' => $key]
             );