From d6d5926b6ec90e7458d566709a254e57ad3158b8 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Tue, 21 Dec 2021 12:24:23 +0000 Subject: [PATCH] [TOOLS][DOC] Add missing documentation, as flagged by doc-check --- src/Controller/Actor.php | 3 +++ src/Core/Controller/FeedController.php | 5 +++++ src/Entity/Actor.php | 6 ++++++ src/Entity/Note.php | 9 +++++++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/Controller/Actor.php b/src/Controller/Actor.php index 7c86fc454f..9051e05523 100644 --- a/src/Controller/Actor.php +++ b/src/Controller/Actor.php @@ -72,6 +72,9 @@ class Actor extends ActorController ); } + /** + * View a group feed and give the option of creating it if it doesn't exist + */ public function groupViewNickname(Request $request, string $nickname) { Nickname::validate($nickname, which: Nickname::CHECK_LOCAL_GROUP); // throws diff --git a/src/Core/Controller/FeedController.php b/src/Core/Controller/FeedController.php index dd3710da45..72c808bc34 100644 --- a/src/Core/Controller/FeedController.php +++ b/src/Core/Controller/FeedController.php @@ -38,6 +38,11 @@ use App\Util\Common; abstract class FeedController extends Controller { + /** + * Post process the result of a feed controller, to remove any + * notes or actors the user specified, as well as format the raw + * list of notes into a usable format + */ public static function post_process(array $result) { $actor = Common::actor(); diff --git a/src/Entity/Actor.php b/src/Entity/Actor.php index 983fc1dcf0..e8c4ef14b0 100644 --- a/src/Entity/Actor.php +++ b/src/Entity/Actor.php @@ -489,6 +489,9 @@ class Actor extends Entity ); } + /** + * Get a URI for this actor, i.e. a unique and stable identifier, using the ID + */ public function getUri(int $type = Router::ABSOLUTE_URL): string { $uri = null; @@ -511,6 +514,9 @@ class Actor extends Entity return $uri; } + /** + * Get a URL for this actor, i.e. a user friendly URL, using the nickname + */ public function getUrl(int $type = Router::ABSOLUTE_URL): string { $url = null; diff --git a/src/Entity/Note.php b/src/Entity/Note.php index 81bcdad8a4..0efae67759 100644 --- a/src/Entity/Note.php +++ b/src/Entity/Note.php @@ -346,6 +346,11 @@ class Note extends Entity )); } + /** + * Find all mentioned actors in this note + * + * @TODO: Seems rather inneficient to be rendering just for this + */ public function getNotificationTargets(array $ids_already_known = []): array { $rendered = null; @@ -354,8 +359,8 @@ class Note extends Entity $this->getContentType(), &$rendered, $this->getActor(), - is_null($this->getLanguageId()) ? null : Language::getById($this->getLanguageId())->getLocale(), - &$mentions]); + \is_null($this->getLanguageId()) ? null : Language::getById($this->getLanguageId())->getLocale(), + &$mentions, ]); $mentioned = []; foreach ($mentions as $mention) { foreach ($mention['mentioned'] as $m) {