diff vendor/zendframework/zend-feed/src/PubSubHubbub/Model/Subscription.php @ 12:7a779792577d

Update Drupal core to v8.4.5 (via Composer)
author Chris Cannam
date Fri, 23 Feb 2018 15:52:07 +0000
parents 4c8ae668cc8c
children
line wrap: on
line diff
--- a/vendor/zendframework/zend-feed/src/PubSubHubbub/Model/Subscription.php	Fri Feb 23 15:51:18 2018 +0000
+++ b/vendor/zendframework/zend-feed/src/PubSubHubbub/Model/Subscription.php	Fri Feb 23 15:52:07 2018 +0000
@@ -31,7 +31,7 @@
      */
     public function setSubscription(array $data)
     {
-        if (!isset($data['id'])) {
+        if (! isset($data['id'])) {
             throw new PubSubHubbub\Exception\InvalidArgumentException(
                 'ID must be set before attempting a save'
             );
@@ -66,12 +66,12 @@
      */
     public function getSubscription($key)
     {
-        if (empty($key) || !is_string($key)) {
+        if (empty($key) || ! is_string($key)) {
             throw new PubSubHubbub\Exception\InvalidArgumentException('Invalid parameter "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;
@@ -86,12 +86,12 @@
      */
     public function hasSubscription($key)
     {
-        if (empty($key) || !is_string($key)) {
+        if (empty($key) || ! is_string($key)) {
             throw new PubSubHubbub\Exception\InvalidArgumentException('Invalid parameter "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 deleteSubscription($key)
     {
         $result = $this->db->select(['id' => $key]);
-        if (count($result)) {
+        if ($result && count($result)) {
             $this->db->delete(
                 ['id' => $key]
             );