upgraded FosUserBundle and Symfony 4.3 (#1005)

This commit is contained in:
Kevin Papst
2019-08-02 16:52:30 +02:00
committed by GitHub
parent 614a50ce0b
commit e11a2a6089
57 changed files with 1577 additions and 1184 deletions

View File

@@ -9,7 +9,6 @@
namespace App\EventSubscriber;
use App\Event\ConfigureAdminMenuEvent;
use App\Event\ConfigureMainMenuEvent;
use KevinPapst\AdminLTEBundle\Event\SidebarMenuEvent;
use KevinPapst\AdminLTEBundle\Event\ThemeEvents;
@@ -73,16 +72,7 @@ class MenuBuilderSubscriber implements EventSubscriberInterface
new MenuItemModel('system', 'menu.system', '')
);
$this->eventDispatcher->dispatch(ConfigureMainMenuEvent::CONFIGURE, $menuEvent);
// @deprecated since 0.9, will be removed with 1.0
$this->eventDispatcher->dispatch(
ConfigureAdminMenuEvent::CONFIGURE,
new ConfigureAdminMenuEvent(
$request,
$menuEvent->getAdminMenu()
)
);
$this->eventDispatcher->dispatch($menuEvent, ConfigureMainMenuEvent::CONFIGURE);
if ($menuEvent->getAdminMenu()->hasChildren()) {
$event->addItem(new MenuItemModel('admin', 'menu.admin', ''));

View File

@@ -11,7 +11,7 @@ namespace App\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
@@ -72,9 +72,6 @@ class RedirectToLocaleSubscriber implements EventSubscriberInterface
$this->locales = array_unique($this->locales);
}
/**
* @return array
*/
public static function getSubscribedEvents(): array
{
return [
@@ -82,10 +79,7 @@ class RedirectToLocaleSubscriber implements EventSubscriberInterface
];
}
/**
* @param GetResponseEvent $event
*/
public function onKernelRequest(GetResponseEvent $event)
public function onKernelRequest(RequestEvent $event)
{
$request = $event->getRequest();

View File

@@ -11,7 +11,7 @@ namespace App\EventSubscriber;
use App\Entity\User;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
@@ -34,7 +34,7 @@ class TimezoneSubscriber implements EventSubscriberInterface
];
}
public function setTimezone(GetResponseEvent $event)
public function setTimezone(RequestEvent $event)
{
if (!$this->canHandleEvent()) {
return;

View File

@@ -155,7 +155,7 @@ class UserPreferenceSubscriber implements EventSubscriberInterface
}
$event = new UserPreferenceEvent($user, $this->getDefaultPreferences($user));
$this->eventDispatcher->dispatch(UserPreferenceEvent::CONFIGURE, $event);
$this->eventDispatcher->dispatch($event, UserPreferenceEvent::CONFIGURE);
foreach ($event->getPreferences() as $preference) {
/* @var UserPreference[] $prefs */

View File

@@ -62,7 +62,7 @@ class UserProfileSubscriber implements EventSubscriberInterface
$user = $this->storage->getToken()->getUser();
$event = new PrepareUserEvent($user);
$this->eventDispatcher->dispatch(PrepareUserEvent::PREPARE, $event);
$this->eventDispatcher->dispatch($event, PrepareUserEvent::PREPARE);
}
/**