]> git.mxchange.org Git - friendica.git/commitdiff
Convert ContactResult->url parameter to UriInterface
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 27 Mar 2023 13:54:52 +0000 (09:54 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 20 Apr 2023 11:43:17 +0000 (07:43 -0400)
src/Core/Search.php
src/Object/Search/ContactResult.php

index 7f05a3a947c05e7348feb734d8b30845c97b8360..45b64eb5179b52a51d0fe20291b230eddfa390e6 100644 (file)
@@ -29,6 +29,7 @@ use Friendica\Object\Search\ContactResult;
 use Friendica\Object\Search\ResultList;
 use Friendica\Util\Network;
 use Friendica\Util\Strings;
+use GuzzleHttp\Psr7\Uri;
 
 /**
  * Specific class to perform searches for different systems. Currently:
@@ -76,7 +77,7 @@ class Search
                                $user_data['name'] ?? '',
                                $user_data['addr'] ?? '',
                                ($contactDetails['addr'] ?? '') ?: ($user_data['url'] ?? ''),
-                               $user_data['url'] ?? '',
+                               new Uri($user_data['url'] ?? ''),
                                $user_data['photo'] ?? '',
                                $user_data['network'] ?? '',
                                $contactDetails['cid'] ?? 0,
@@ -142,7 +143,7 @@ class Search
                                $profile['name'] ?? '',
                                $profile['addr'] ?? '',
                                ($contactDetails['addr'] ?? '') ?: $profile_url,
-                               $profile_url,
+                               new Uri($profile_url),
                                $profile['photo'] ?? '',
                                Protocol::DFRN,
                                $contactDetails['cid'] ?? 0,
@@ -180,7 +181,7 @@ class Search
                                $contact['name'],
                                $contact['addr'],
                                $contact['addr'] ?: $contact['url'],
-                               $contact['url'],
+                               new Uri($contact['url']),
                                $contact['photo'],
                                $contact['network'],
                                0,
index c2922ea0eddab491c52069a2b06ae2c819080f21..c46b9b6e4c73731333a8a79fb390fe567e789110 100644 (file)
@@ -22,6 +22,7 @@
 namespace Friendica\Object\Search;
 
 use Friendica\Model\Search;
+use Psr\Http\Message\UriInterface;
 
 /**
  * A search result for contact searching
@@ -51,7 +52,7 @@ class ContactResult implements IResult
         */
        private $item;
        /**
-        * @var string
+        * @var UriInterface
         */
        private $url;
        /**
@@ -108,9 +109,9 @@ class ContactResult implements IResult
        }
 
        /**
-        * @return string
+        * @return UriInterface
         */
-       public function getUrl(): string
+       public function getUrl(): UriInterface
        {
                return $this->url;
        }
@@ -143,14 +144,14 @@ class ContactResult implements IResult
         * @param string $name
         * @param string $addr
         * @param string $item
-        * @param string $url
+        * @param UriInterface $url
         * @param string $photo
         * @param string $network
         * @param int    $cid
         * @param int    $pCid
         * @param string $tags
         */
-       public function __construct($name, $addr, $item, $url, $photo, $network, $cid = 0, $pCid = 0, $tags = '')
+       public function __construct($name, $addr, $item, UriInterface $url, $photo, $network, $cid = 0, $pCid = 0, $tags = '')
        {
                $this->name    = $name;
                $this->addr    = $addr;