diff --git a/components/Feed/Feed.php b/components/Feed/Feed.php index 55ec18c128..2bff473ebe 100644 --- a/components/Feed/Feed.php +++ b/components/Feed/Feed.php @@ -36,6 +36,12 @@ use Doctrine\ORM\QueryBuilder; class Feed extends Component { + /** + * Perform a high level query on notes or actors + * + * Supports a variety of query terms and is used both in feeds and + * in search. Uses query builders to allow for extension + */ public static function query(string $query, int $page, ?string $language = null, ?Actor $actor = null): array { $note_criteria = null; diff --git a/components/Group/Group.php b/components/Group/Group.php index 8fcc4c21c8..c505f836a4 100644 --- a/components/Group/Group.php +++ b/components/Group/Group.php @@ -44,6 +44,9 @@ class Group extends Component return Event::next; } + /** + * Add an to the profile card for groups, if the current actor can access them + */ public function onAppendCardProfile(array $vars, array &$res): bool { $actor = Common::actor(); diff --git a/components/Tag/Controller/Tag.php b/components/Tag/Controller/Tag.php index 8ea835c4a1..c79410c930 100644 --- a/components/Tag/Controller/Tag.php +++ b/components/Tag/Controller/Tag.php @@ -86,6 +86,9 @@ class Tag extends Controller ); } + /** + * Generic settings page for an Actor's self tags + */ public static function settingsSelfTags(Request $request, E\Actor $target, string $details_id) { $actor = Common::actor(); @@ -98,7 +101,10 @@ class Tag extends Controller [$add_form, $existing_form] = SelfTagsForm::handleTags( $request, $actor_tags, - handle_new: function ($form) use ($request, $target, $details_id) { + handle_new: /** + * Handle adding tags + */ + function ($form) use ($request, $target, $details_id) { $data = $form->getData(); $tags = $data['new-tags']; $language = $target->getTopLanguage()->getLocale(); @@ -117,7 +123,10 @@ class Tag extends Controller Cache::delete(E\Actor::cacheKeys($target->getId(), $target->getId())['tags']); throw new RedirectException($request->get('_route'), ['nickname' => $target->getNickname(), 'open' => $details_id]); }, - handle_existing: function ($form, array $form_definition) use ($request, $target, $details_id) { + handle_existing: /** + * Handle changes to the existing tags + */ + function ($form, array $form_definition) use ($request, $target, $details_id) { $data = $form->getData(); $changed = false; foreach (array_chunk($form_definition, 3) as $entry) { diff --git a/plugins/TagBasedFiltering/TagBasedFiltering.php b/plugins/TagBasedFiltering/TagBasedFiltering.php index 26e16e6121..759da83ecd 100644 --- a/plugins/TagBasedFiltering/TagBasedFiltering.php +++ b/plugins/TagBasedFiltering/TagBasedFiltering.php @@ -76,9 +76,14 @@ class TagBasedFiltering extends Plugin ]; } + /** + * Filter out tags from notes or actors, per the user request + */ public function onFilterNoteList(?Actor $actor, array &$notes, Request $request) { - if (\is_null($actor)) return Event::next; + if (\is_null($actor)) { + return Event::next; + } $blocked_note_tags = Cache::get( self::cacheKeys($actor)['note'], fn () => DB::dql('select ntb from note_tag_block ntb where ntb.blocker = :blocker', ['blocker' => $actor->getId()]),