From f628c540a4b24af39d76596f4ded14d843388092 Mon Sep 17 00:00:00 2001 From: Art4 Date: Sun, 1 Dec 2024 22:11:04 +0000 Subject: [PATCH] Fix errors in Contact namespace --- src/Contact/Avatar.php | 3 --- .../FriendSuggest/Entity/FriendSuggest.php | 2 +- .../Repository/FriendSuggest.php | 23 ++++--------------- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/Contact/Avatar.php b/src/Contact/Avatar.php index 66930119e8..7827465b4e 100644 --- a/src/Contact/Avatar.php +++ b/src/Contact/Avatar.php @@ -235,9 +235,6 @@ class Avatar /** * Delete locally cached avatar pictures of a contact - * - * @param string $avatar - * @return bool */ public static function deleteCache(array $contact): bool { diff --git a/src/Contact/FriendSuggest/Entity/FriendSuggest.php b/src/Contact/FriendSuggest/Entity/FriendSuggest.php index f5bb9dd993..67159a9ea0 100644 --- a/src/Contact/FriendSuggest/Entity/FriendSuggest.php +++ b/src/Contact/FriendSuggest/Entity/FriendSuggest.php @@ -19,7 +19,7 @@ use Friendica\BaseEntity; * @property-read string $request * @property-read string $photo * @property-read string $note - * @property-read \DateTime created + * @property-read \DateTime $created * @property-read int|null $id */ class FriendSuggest extends BaseEntity diff --git a/src/Contact/FriendSuggest/Repository/FriendSuggest.php b/src/Contact/FriendSuggest/Repository/FriendSuggest.php index a93c4a2ddb..dee3f29b2e 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; +use Friendica\Contact\FriendSuggest\Entity\FriendSuggest as EntityFriendSuggest; use Friendica\Contact\FriendSuggest\Exception\FriendSuggestNotFoundException; use Friendica\Contact\FriendSuggest\Exception\FriendSuggestPersistenceException; use Friendica\Contact\FriendSuggest\Factory; @@ -30,7 +30,7 @@ class FriendSuggest extends BaseRepository parent::__construct($database, $logger, $factory); } - private function convertToTableRow(Entity\FriendSuggest $fsuggest): array + private function convertToTableRow(EntityFriendSuggest $fsuggest): array { return [ 'uid' => $fsuggest->uid, @@ -45,14 +45,9 @@ class FriendSuggest extends BaseRepository } /** - * @param array $condition - * @param array $params - * - * @return Entity\FriendSuggest - * * @throws NotFoundException The underlying exception if there's no FriendSuggest with the given conditions */ - private function selectOne(array $condition, array $params = []): Entity\FriendSuggest + private function selectOne(array $condition, array $params = []): EntityFriendSuggest { return parent::_selectOne($condition, $params); } @@ -71,13 +66,9 @@ class FriendSuggest extends BaseRepository } /** - * @param int $id - * - * @return Entity\FriendSuggest - * * @throws FriendSuggestNotFoundException in case there's no suggestion for this id */ - public function selectOneById(int $id): Entity\FriendSuggest + public function selectOneById(int $id): EntityFriendSuggest { try { return $this->selectOne(['id' => $id]); @@ -103,13 +94,9 @@ class FriendSuggest extends BaseRepository } /** - * @param Entity\FriendSuggest $fsuggest - * - * @return Entity\FriendSuggest - * * @throws FriendSuggestNotFoundException in case the underlying storage cannot save the suggestion */ - public function save(Entity\FriendSuggest $fsuggest): Entity\FriendSuggest + public function save(EntityFriendSuggest $fsuggest): EntityFriendSuggest { try { $fields = $this->convertToTableRow($fsuggest);