[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

@@ -30,6 +30,7 @@ use App\Core\Router;
use App\Util\Exception\RedirectException;
use App\Util\Exception\ServerException;
use App\Util\Formatting;
use EventResult;
use Plugin\ProfileColor\Controller as C;
use Symfony\Component\HttpFoundation\Request;
@@ -51,7 +52,7 @@ class ProfileColor extends Plugin
*
* @return bool hook value; true means continue processing, false means stop
*/
public function onAddRoute(Router $r): bool
public function onAddRoute(Router $r): EventResult
{
$r->connect('settings_profile_color', 'settings/color', [Controller\ProfileColor::class, 'profileColorSettings']);
return Event::next;
@@ -61,7 +62,7 @@ class ProfileColor extends Plugin
* @throws RedirectException
* @throws ServerException
*/
public function onPopulateSettingsTabs(Request $request, string $section, array &$tabs): bool
public function onPopulateSettingsTabs(Request $request, string $section, array &$tabs): EventResult
{
if ($section === 'colours') {
$tabs[] = [
@@ -77,7 +78,7 @@ class ProfileColor extends Plugin
/**
* Renders profileColorView, which changes the background color of that profile.
*/
public function onAppendCardProfile(array $vars, array &$res): bool
public function onAppendCardProfile(array $vars, array &$res): EventResult
{
$actor = $vars['actor'];
if ($actor !== null) {