]> git.mxchange.org Git - friendica.git/commitdiff
Apply suggestions from code review
authorMichael Vogel <icarus@dabo.de>
Fri, 25 Jun 2021 18:00:59 +0000 (20:00 +0200)
committerGitHub <noreply@github.com>
Fri, 25 Jun 2021 18:00:59 +0000 (20:00 +0200)
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
src/Model/Contact.php
src/Object/Api/Mastodon/Account.php

index fad1db3473d3209506669fe227aa54ccaca7d38f..dc784827866c87ef964b5476f252d90f267a8a6a 100644 (file)
@@ -1668,9 +1668,9 @@ class Contact
         * @param integer $cid contact id
         * @return string avatar link
         */
-       public static function getAvatarForContact(int $cid):string
+       public static function getAvatarUrlForId(int $cid):string
        {
-               return DI::baseUrl() . '/photo/contact/'. $cid;
+               return DI::baseUrl() . '/photo/contact/' . $cid;
        }
 
        /**
@@ -1679,9 +1679,9 @@ class Contact
         * @param integer $cid contact id
         * @return string header link
         */
-       public static function getHeaderForContact(int $cid):string
+       public static function getHeaderUrlForId(int $cid):string
        {
-               return DI::baseUrl() . '/photo/header/'. $cid;
+               return DI::baseUrl() . '/photo/header/' . $cid;
        }
 
        /**
index b34af795127778b21649a8ff64f8def4f2375473..2ea9da70482358bd4b232e66e4618c2f9bd5095f 100644 (file)
@@ -112,9 +112,9 @@ class Account extends BaseDataTransferObject
 
                $this->note            = BBCode::convert($publicContact['about'], false);
                $this->url             = $publicContact['url'];
-               $this->avatar          = (($userContact['photo'] ?? '') ?: $publicContact['photo']) ?: Contact::getAvatarForContact(($userContact['id'] ?? 0) ?: $publicContact['id']);
+               $this->avatar          = $userContact['photo'] ?? '' ?: $publicContact['photo'] ?: Contact::getAvatarUrlForId($userContact['id'] ?? 0 ?: $publicContact['id']);
                $this->avatar_static   = $this->avatar;
-               $this->header          = Contact::getHeaderForContact(($userContact['id'] ?? 0) ?: $publicContact['id']);
+               $this->header          = Contact::getHeaderUrlForId($userContact['id'] ?? 0 ?: $publicContact['id']);
                $this->header_static   = $this->header;
                $this->followers_count = $apcontact['followers_count'] ?? 0;
                $this->following_count = $apcontact['following_count'] ?? 0;