[TOOLS] Fix errors pointed out by PHPStan level 4

This commit is contained in:
2022-10-19 22:38:49 +01:00
parent 4d7742e0e1
commit edeee49af9
37 changed files with 168 additions and 198 deletions

View File

@@ -33,6 +33,7 @@ use App\Core\Router;
use App\Core\VisibilityScope;
use App\Entity\Activity;
use App\Entity\Actor;
use App\Entity\LocalUser;
use App\Entity\Note;
use App\Util\Common;
use App\Util\Exception\BugFoundException;
@@ -180,7 +181,9 @@ class Posting extends Component
): array {
$scope ??= VisibilityScope::EVERYWHERE; // TODO: If site is private, default to LOCAL
$reply_to_id = \is_null($reply_to) ? null : (\is_int($reply_to) ? $reply_to : $reply_to->getId());
$mentions = [];
/** @var array<int, array{ mentioned?: array<int, Actor|LocalUser> }> $mentions */
$mentions = [];
if (\is_null($rendered) && !empty($content)) {
Event::handle('RenderNoteContent', [$content, $content_type, &$rendered, $actor, $locale, &$mentions]);
}