]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/APContact.php
Merge pull request #9 from nupplaphil/dependabot/composer/guzzlehttp/guzzle-6.5.8
[friendica.git] / src / Model / APContact.php
index fba0c24f4c22d2613ff15e29e8d78a803d76d7fd..9269ee7903875f386e07a26645aebfe14441cf72 100644 (file)
@@ -116,6 +116,7 @@ class APContact
         * @return array profile array
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws \ImagickException
+        * @todo Rewrite parameter $update to avoid true|false|null (boolean is binary, null adds a third case)
         */
        public static function getByURL(string $url, $update = null): array
        {
@@ -124,7 +125,7 @@ class APContact
                        return [];
                }
 
-               $fetched_contact = false;
+               $fetched_contact = [];
 
                if (empty($update)) {
                        if (is_null($update)) {
@@ -206,7 +207,7 @@ class APContact
 
                        if ($failed) {
                                self::markForArchival($fetched_contact ?: []);
-                               return $fetched_contact ?? [];
+                               return $fetched_contact;
                        }
                }
 
@@ -275,7 +276,7 @@ class APContact
 
                // Quit if none of the basic values are set
                if (empty($apcontact['url']) || empty($apcontact['type']) || (($apcontact['type'] != 'Tombstone') && empty($apcontact['inbox']))) {
-                       return $fetched_contact ?? [];
+                       return $fetched_contact;
                } elseif ($apcontact['type'] == 'Tombstone') {
                        // The "inbox" field must have a content
                        $apcontact['inbox'] = '';
@@ -283,7 +284,7 @@ class APContact
 
                // Quit if this doesn't seem to be an account at all
                if (!in_array($apcontact['type'], ActivityPub::ACCOUNT_TYPES)) {
-                       return $fetched_contact ?? [];
+                       return $fetched_contact;
                }
 
                $parts = parse_url($apcontact['url']);
@@ -526,6 +527,7 @@ class APContact
         *
         * @param string  $url    inbox url
         * @param boolean $shared Shared Inbox
+        * @return void
         */
        private static function unarchiveInbox(string $url, bool $shared)
        {