Fix overly strict return value for terminateFriendship methods
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 7 Oct 2021 00:18:44 +0000 (20:18 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 7 Oct 2021 00:18:44 +0000 (20:18 -0400)
src/Core/Protocol.php
src/Model/Contact.php

index 8583ac243c65bcb4ed44bdbdcc36c9e96f8d5305..3484d281b1c52bbf904f9c5725dda759e083f6b2 100644 (file)
@@ -213,11 +213,11 @@ class Protocol
         *
         * @param array   $user    User unfriending
         * @param array   $contact Contact unfriended
-        * @return bool|null true if successful, false if not, null if no action was performed
+        * @return bool|null true if successful, false if not, null if no remote action was performed
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       public static function terminateFriendship(array $user, array $contact): bool
+       public static function terminateFriendship(array $user, array $contact): ?bool
        {
                if (empty($contact['network'])) {
                        throw new \InvalidArgumentException('Missing network key in contact array');
index 83ca33639a2edfbebc83d62249dfae9ae1b2cd16..cbe370a4aa8250d35a899d3b1de59d2e32105adf 100644 (file)
@@ -832,11 +832,11 @@ class Contact
         * @param array   $user    User unfriending
         * @param array   $contact Contact (uid != 0) unfriended
         * @param boolean $two_way Revoke eventual inbound follow as well
-        * @return bool|null true if successful, false if not, null if no action was performed
+        * @return bool|null true if successful, false if not, null if no remote action was performed
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       public static function terminateFriendship(array $user, array $contact): bool
+       public static function terminateFriendship(array $user, array $contact): ?bool
        {
                $result = Protocol::terminateFriendship($user, $contact);