[TOOLS] Run CS-Fixer on whole project

This commit is contained in:
2022-02-26 14:45:38 +00:00
parent 255c44bbf0
commit 45c7888676
24 changed files with 146 additions and 171 deletions

View File

@@ -23,7 +23,6 @@ namespace Component\Notification;
use App\Core\DB\DB;
use App\Core\Event;
use App\Util\Exception\ServerException;
use function App\Core\I18n\_m;
use App\Core\Log;
use App\Core\Modules\Component;
@@ -32,15 +31,14 @@ use App\Core\Router\Router;
use App\Entity\Activity;
use App\Entity\Actor;
use App\Entity\LocalUser;
use App\Util\Exception\ServerException;
use Component\FreeNetwork\FreeNetwork;
use Component\Notification\Controller\Feed;
use Exception;
use Throwable;
class Notification extends Component
{
/**
* @param RouteLoader $m
* @return bool
*/
public function onAddRoute(RouteLoader $m): bool
{
$m->connect('feed_notifications', '/feed/notifications', [Feed::class, 'notifications']);
@@ -48,10 +46,6 @@ class Notification extends Component
}
/**
* @param int $actor_id
* @param LocalUser $user
* @param int $ordering
* @return bool
* @throws ServerException
*/
public function onCreateDefaultFeeds(int $actor_id, LocalUser $user, int &$ordering): bool
@@ -69,11 +63,6 @@ class Notification extends Component
/**
* Enqueues a notification for an Actor (such as person or group) which means
* it shows up in their home feed and such.
* @param Actor $sender
* @param Activity $activity
* @param array $ids_already_known
* @param string|null $reason
* @return bool
*/
public function onNewNotification(Actor $sender, Activity $activity, array $ids_already_known = [], ?string $reason = null): bool
{
@@ -87,11 +76,6 @@ class Notification extends Component
/**
* Bring given Activity to Targets's attention
* @param Actor $sender
* @param Activity $activity
* @param array $targets
* @param string|null $reason
* @return bool
*/
public static function notify(Actor $sender, Activity $activity, array $targets, ?string $reason = null): bool
{
@@ -125,11 +109,10 @@ class Notification extends Component
'target_id' => $target->getId(),
'reason' => $reason,
])));
} catch (\Exception|\Throwable $e) {
} catch (Exception|Throwable $e) {
// We do our best not to record duplicated notifications, but it's not insane that can happen
Log::error('It was attempted to record an invalid notification!', [$e]);
}
}
FreeNetwork::notify($sender, $activity, $remote_targets, $reason);