[TOOLS] Continue raising PHPStan to level 6

This commit is contained in:
2022-10-19 22:39:17 +01:00
parent e6bb418fe6
commit c31f3d4997
25 changed files with 233 additions and 58 deletions

View File

@@ -44,6 +44,10 @@ abstract class FeedController extends OrderedCollection
* Post-processing of 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
*
* @template T of Note|Actor
* @param T[] $result
* @return T[]
*/
protected function postProcess(array $result): array
{
@@ -58,6 +62,9 @@ abstract class FeedController extends OrderedCollection
return $result;
}
/**
* @param Note[] $notes
*/
private static function enforceScope(array &$notes, ?Actor $actor, ?Actor $in = null): void
{
$notes = F\select($notes, fn (Note $n) => $n->isVisibleTo($actor, $in));