[DOC] Add documentation to methods flagged by doc-check
This commit is contained in:
parent
dabf5576d3
commit
1947e99430
@ -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;
|
||||
|
@ -44,6 +44,9 @@ class Group extends Component
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an <a href=group_settings> to the profile card for groups, if the current actor can access them
|
||||
*/
|
||||
public function onAppendCardProfile(array $vars, array &$res): bool
|
||||
{
|
||||
$actor = Common::actor();
|
||||
|
@ -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) {
|
||||
|
@ -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()]),
|
||||
|
Loading…
Reference in New Issue
Block a user