fix order and update of user settings form

This commit is contained in:
Kevin Papst
2020-08-18 23:22:16 +02:00
parent fbb3dd89cf
commit d8ae7635d1
7 changed files with 74 additions and 89 deletions

View File

@@ -17,31 +17,23 @@ use Symfony\Component\HttpKernel\Event\KernelEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
class UserProfileSubscriber implements EventSubscriberInterface
final class UserProfileSubscriber implements EventSubscriberInterface
{
/**
* @var EventDispatcherInterface
*/
protected $eventDispatcher;
private $eventDispatcher;
/**
* @var TokenStorageInterface
*/
protected $storage;
private $storage;
/**
* @param EventDispatcherInterface $dispatcher
* @param TokenStorageInterface $storage
*/
public function __construct(EventDispatcherInterface $dispatcher, TokenStorageInterface $storage)
{
$this->eventDispatcher = $dispatcher;
$this->storage = $storage;
}
/**
* @return array
*/
public static function getSubscribedEvents(): array
{
return [
@@ -49,10 +41,7 @@ class UserProfileSubscriber implements EventSubscriberInterface
];
}
/**
* @param KernelEvent $event
*/
public function prepareUserProfile(KernelEvent $event)
public function prepareUserProfile(KernelEvent $event): void
{
if (!$this->canHandleEvent($event)) {
return;
@@ -65,11 +54,7 @@ class UserProfileSubscriber implements EventSubscriberInterface
$this->eventDispatcher->dispatch($event);
}
/**
* @param KernelEvent $event
* @return bool
*/
protected function canHandleEvent(KernelEvent $event): bool
private function canHandleEvent(KernelEvent $event): bool
{
// Ignore sub-requests
if (!$event->isMasterRequest()) {