]> git.mxchange.org Git - friendica.git/commitdiff
Changed:
authorRoland Häder <roland@mxchange.org>
Fri, 16 Sep 2022 15:37:24 +0000 (17:37 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 9 Jun 2023 19:46:22 +0000 (21:46 +0200)
- added missing type-hints
- changed array initialization

src/Network/Probe.php

index b1931ae6d36bb6d5cbf8b43bd693cf92ae3024ba..bd98f39103bc2b8da1ce388a1939e4fec961e731 100644 (file)
@@ -346,6 +346,7 @@ class Probe
         * @return array uri data
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
+        * @todo Choice: implement $cache parameter or remove documentation
         */
        public static function uri(string $uri, string $network = '', int $uid = -1): array
        {
@@ -1181,7 +1182,6 @@ class Probe
                        $data = self::pollHcard($profile_link, $data, true);
                }
 
-               $prof_data = [];
 
                if (empty($data['addr']) || empty($data['nick'])) {
                        $probe_data = self::uri($profile_link);
@@ -1189,15 +1189,17 @@ class Probe
                        $data['nick'] = ($data['nick'] ?? '') ?: $probe_data['nick'];
                }
 
-               $prof_data['addr']         = $data['addr'];
-               $prof_data['nick']         = $data['nick'];
-               $prof_data['dfrn-request'] = $data['request'] ?? null;
-               $prof_data['dfrn-confirm'] = $data['confirm'] ?? null;
-               $prof_data['dfrn-notify']  = $data['notify']  ?? null;
-               $prof_data['dfrn-poll']    = $data['poll']    ?? null;
-               $prof_data['photo']        = $data['photo']   ?? null;
-               $prof_data['fn']           = $data['name']    ?? null;
-               $prof_data['key']          = $data['pubkey']  ?? null;
+               $prof_data = [
+                       'addr'         => $data['addr'],
+                       'nick'         => $data['nick'],
+                       'dfrn-request' => $data['request'] ?? null,
+                       'dfrn-confirm' => $data['confirm'] ?? null,
+                       'dfrn-notify'  => $data['notify']  ?? null,
+                       'dfrn-poll'    => $data['poll']    ?? null,
+                       'photo'        => $data['photo']   ?? null,
+                       'fn'           => $data['name']    ?? null,
+                       'key'          => $data['pubkey']  ?? null,
+               ];
 
                Logger::debug('Result', ['link' => $profile_link, 'data' => $prof_data]);