From 18d847275a29a699678847a72b660e3137aa193d Mon Sep 17 00:00:00 2001 From: Artur Weigandt Date: Sat, 14 Dec 2024 15:45:50 +0100 Subject: [PATCH 1/6] Update src/Contact/FriendSuggest/Repository/FriendSuggest.php Co-authored-by: Hypolite Petovan --- src/Contact/FriendSuggest/Repository/FriendSuggest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Contact/FriendSuggest/Repository/FriendSuggest.php b/src/Contact/FriendSuggest/Repository/FriendSuggest.php index dee3f29b2e..88a071374f 100644 --- a/src/Contact/FriendSuggest/Repository/FriendSuggest.php +++ b/src/Contact/FriendSuggest/Repository/FriendSuggest.php @@ -9,7 +9,7 @@ namespace Friendica\Contact\FriendSuggest\Repository; use Friendica\BaseRepository; use Friendica\Contact\FriendSuggest\Collection; -use Friendica\Contact\FriendSuggest\Entity\FriendSuggest as EntityFriendSuggest; +use Friendica\Contact\FriendSuggest\Entity\FriendSuggest as FriendSuggestEntity; use Friendica\Contact\FriendSuggest\Exception\FriendSuggestNotFoundException; use Friendica\Contact\FriendSuggest\Exception\FriendSuggestPersistenceException; use Friendica\Contact\FriendSuggest\Factory; From 8178f87e615d1967d53f04921649d6726656a6db Mon Sep 17 00:00:00 2001 From: Art4 Date: Sat, 14 Dec 2024 14:49:52 +0000 Subject: [PATCH 2/6] Rename class alias --- src/Contact/FriendSuggest/Repository/FriendSuggest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Contact/FriendSuggest/Repository/FriendSuggest.php b/src/Contact/FriendSuggest/Repository/FriendSuggest.php index 88a071374f..1b22c7b797 100644 --- a/src/Contact/FriendSuggest/Repository/FriendSuggest.php +++ b/src/Contact/FriendSuggest/Repository/FriendSuggest.php @@ -30,7 +30,7 @@ class FriendSuggest extends BaseRepository parent::__construct($database, $logger, $factory); } - private function convertToTableRow(EntityFriendSuggest $fsuggest): array + private function convertToTableRow(FriendSuggestEntity $fsuggest): array { return [ 'uid' => $fsuggest->uid, @@ -47,7 +47,7 @@ class FriendSuggest extends BaseRepository /** * @throws NotFoundException The underlying exception if there's no FriendSuggest with the given conditions */ - private function selectOne(array $condition, array $params = []): EntityFriendSuggest + private function selectOne(array $condition, array $params = []): FriendSuggestEntity { return parent::_selectOne($condition, $params); } @@ -68,7 +68,7 @@ class FriendSuggest extends BaseRepository /** * @throws FriendSuggestNotFoundException in case there's no suggestion for this id */ - public function selectOneById(int $id): EntityFriendSuggest + public function selectOneById(int $id): FriendSuggestEntity { try { return $this->selectOne(['id' => $id]); @@ -96,7 +96,7 @@ class FriendSuggest extends BaseRepository /** * @throws FriendSuggestNotFoundException in case the underlying storage cannot save the suggestion */ - public function save(EntityFriendSuggest $fsuggest): EntityFriendSuggest + public function save(FriendSuggestEntity $fsuggest): FriendSuggestEntity { try { $fields = $this->convertToTableRow($fsuggest); From 6a2e8739d1144aabba3f9fbb0eac21c42d5b0d9b Mon Sep 17 00:00:00 2001 From: Art4 Date: Sat, 14 Dec 2024 14:53:56 +0000 Subject: [PATCH 3/6] Rename variable --- src/Content/Post/Entity/PostMedia.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Content/Post/Entity/PostMedia.php b/src/Content/Post/Entity/PostMedia.php index 0dbbc54d2e..4b4268b750 100644 --- a/src/Content/Post/Entity/PostMedia.php +++ b/src/Content/Post/Entity/PostMedia.php @@ -164,17 +164,17 @@ class PostMedia extends BaseEntity /** * Get preview path for given media id relative to the base URL * - * @param string $size One of the Proxy::SIZE_* constants - * @param bool $blurred If "true", the preview will be blurred + * @param string $size One of the Proxy::SIZE_* constants + * @param bool $blur If "true", the preview will be blurred * @return string preview link */ - public function getPreviewPath(string $size = '', bool $blurred = false): string + public function getPreviewPath(string $size = '', bool $blur = false): string { $path = '/photo/preview/' . (Proxy::getPixelsFromSize($size) ? Proxy::getPixelsFromSize($size) . '/' : '') . $this->id; - if ($blurred) { + if ($blur) { $path .= '?' . http_build_query(['blur' => true]); } return $path; From 59404752f929173c31ec2d139e5d3118b4d013d4 Mon Sep 17 00:00:00 2001 From: Art4 Date: Sat, 14 Dec 2024 14:58:19 +0000 Subject: [PATCH 4/6] Change return type --- src/Model/GServer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/GServer.php b/src/Model/GServer.php index c458e379b4..a0c1be7bfc 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -503,10 +503,10 @@ class GServer * * @param UriInterface $dirtyUri * - * @return string cleaned URI + * @return UriInterface cleaned URI * @throws Exception */ - public static function cleanUri(UriInterface $dirtyUri): string + public static function cleanUri(UriInterface $dirtyUri): UriInterface { return $dirtyUri ->withUserInfo('') From 76e5495e155f543155c239af68b3bd0e679cca5e Mon Sep 17 00:00:00 2001 From: Art4 Date: Sat, 14 Dec 2024 14:58:34 +0000 Subject: [PATCH 5/6] Remove unused use statement --- src/Security/TwoFactor/Repository/TrustedBrowser.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Security/TwoFactor/Repository/TrustedBrowser.php b/src/Security/TwoFactor/Repository/TrustedBrowser.php index b55e1d46eb..2f5fb5f02b 100644 --- a/src/Security/TwoFactor/Repository/TrustedBrowser.php +++ b/src/Security/TwoFactor/Repository/TrustedBrowser.php @@ -7,7 +7,6 @@ namespace Friendica\Security\TwoFactor\Repository; -use Friendica\Security\TwoFactor; use Friendica\Database\Database; use Friendica\Security\TwoFactor\Exception\TrustedBrowserNotFoundException; use Friendica\Security\TwoFactor\Exception\TrustedBrowserPersistenceException; From 7e05416da674b318e409a9e48f0b9667f22ee037 Mon Sep 17 00:00:00 2001 From: Art4 Date: Sat, 14 Dec 2024 20:12:04 +0000 Subject: [PATCH 6/6] Renemae Notification entity alias --- src/Model/Subscription.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Subscription.php b/src/Model/Subscription.php index 18b6a48e62..be18a1af78 100644 --- a/src/Model/Subscription.php +++ b/src/Model/Subscription.php @@ -12,7 +12,7 @@ use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Factory\Api\Mastodon\Notification as NotificationFactory; -use Friendica\Navigation\Notifications\Entity\Notification as EntityNotification; +use Friendica\Navigation\Notifications\Entity\Notification as NotificationEntity; use Friendica\Object\Api\Mastodon\Notification; use Minishlink\WebPush\VAPID; @@ -119,7 +119,7 @@ class Subscription * * @return void */ - public static function pushByNotification(EntityNotification $notification) + public static function pushByNotification(NotificationEntity $notification) { $type = NotificationFactory::getType($notification);