[CORE][Event] Make all events return \EventResult, enforced at container build time

This commit is contained in:
2022-04-03 21:40:32 +01:00
parent aef1fac536
commit d4b7e990ce
60 changed files with 345 additions and 239 deletions

View File

@@ -41,6 +41,7 @@ use App\Entity\Feed;
use App\Entity\LocalUser;
use App\Util\Nickname;
use Component\Collection\Util\MetaCollectionTrait;
use EventResult;
use Plugin\AttachmentCollections\Controller\AttachmentCollections as AttachmentCollectionsController;
use Plugin\AttachmentCollections\Entity\AttachmentCollection;
use Plugin\AttachmentCollections\Entity\AttachmentCollectionEntry;
@@ -122,7 +123,7 @@ class AttachmentCollections extends Plugin
return array_map(fn ($x) => $x['attachment_collection_id'], $res);
}
public function onAddRoute(Router $r): bool
public function onAddRoute(Router $r): EventResult
{
// View all collections by actor id and nickname
$r->connect(
@@ -149,7 +150,7 @@ class AttachmentCollections extends Plugin
return Event::next;
}
public function onCreateDefaultFeeds(int $actor_id, LocalUser $user, int &$ordering)
public function onCreateDefaultFeeds(int $actor_id, LocalUser $user, int &$ordering): EventResult
{
DB::persist(Feed::create([
'actor_id' => $actor_id,