[TOOLS][CS-FIXER] Run new PHP CS Fixer config. Notably, adds strict_types

This commit is contained in:
2021-10-10 09:26:18 +01:00
committed by Diogo Peralta Cordeiro
parent 8ef2d3339f
commit 9109c61af5
327 changed files with 2246 additions and 2616 deletions

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types = 1);
// {{{ License
// This file is part of GNU social - https://www.gnu.org/software/social
//
@@ -29,7 +31,7 @@ class TreeNotes extends Plugin
*/
public function onFormatNoteList(array $notes_in, ?array &$notes_out)
{
$roots = array_filter($notes_in, function (Note $note) { return $note->getReplyTo() == null; });
$roots = array_filter($notes_in, fn (Note $note) => $note->getReplyTo() == null);
$notes_out = $this->build_tree($roots, $notes_in);
}
@@ -44,7 +46,7 @@ class TreeNotes extends Plugin
private function build_subtree(Note $parent, array $notes)
{
$children = array_filter($notes, function (Note $n) use ($parent) { return $parent->getId() == $n->getReplyTo(); });
$children = array_filter($notes, fn (Note $n) => $parent->getId() == $n->getReplyTo());
return ['note' => $parent, 'replies' => $this->build_tree($children, $notes)];
}
}