mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Refactored
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
|
||||
namespace App\Subscriber;
|
||||
|
||||
use App\Event\Menu\Subbar\SourceMenuEvent;
|
||||
use App\Event\Menu\MenuEvent;
|
||||
use App\DBAL\Types\MenuEventType;
|
||||
|
||||
class SourceMenuSubscriber extends AbstractEntityMenuSubscriber
|
||||
{
|
||||
public function onSourceMenuConfigure(SourceMenuEvent $event): void
|
||||
public function onSourceMenuConfigure(MenuEvent $event): void
|
||||
{
|
||||
$menu = $event->getItem();
|
||||
$menu->addChild($this->translator->trans('edit'), [
|
||||
@@ -33,7 +34,7 @@ class SourceMenuSubscriber extends AbstractEntityMenuSubscriber
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
SourceMenuEvent::EVENT => 'onSourceMenuConfigure',
|
||||
MenuEventType::SOURCE => 'onSourceMenuConfigure',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -2,11 +2,12 @@
|
||||
|
||||
namespace App\Subscriber;
|
||||
|
||||
use App\Event\Menu\Topbar\UserMenuEvent;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use Knp\Menu\ItemInterface;
|
||||
use App\Event\Menu\MenuEvent;
|
||||
use App\DBAL\Types\MenuEventType;
|
||||
|
||||
class UserMenuSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
@@ -26,7 +27,7 @@ class UserMenuSubscriber implements EventSubscriberInterface
|
||||
$this->translator = $translator;
|
||||
}
|
||||
|
||||
public function onUserMenuConfigure(UserMenuEvent $event): void
|
||||
public function onUserMenuConfigure(MenuEvent $event): void
|
||||
{
|
||||
$menu = $event->getItem();
|
||||
$menu->addChild($this->translator->trans('start'), [
|
||||
@@ -89,7 +90,7 @@ class UserMenuSubscriber implements EventSubscriberInterface
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
UserMenuEvent::EVENT => 'onUserMenuConfigure',
|
||||
MenuEventType::USER=> 'onUserMenuConfigure',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user