From f03e66b34e64825d9f9fb9733433f338a0fa21e1 Mon Sep 17 00:00:00 2001 From: Tobias Gross-Vogt <tobias.gross-vogt@tugraz.at> Date: Mon, 27 Feb 2023 14:28:17 +0100 Subject: [PATCH] assure initialization of eventStack --- .../EventSubscriber/AbstractGetAttributeSubscriber.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Authorization/EventSubscriber/AbstractGetAttributeSubscriber.php b/src/Authorization/EventSubscriber/AbstractGetAttributeSubscriber.php index fadd991..79b1d4e 100644 --- a/src/Authorization/EventSubscriber/AbstractGetAttributeSubscriber.php +++ b/src/Authorization/EventSubscriber/AbstractGetAttributeSubscriber.php @@ -11,7 +11,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; abstract class AbstractGetAttributeSubscriber implements EventSubscriberInterface { /** @var array */ - private $eventStack; + private $eventStack = []; public static function getSubscribedEvents(): array { @@ -21,11 +21,6 @@ abstract class AbstractGetAttributeSubscriber implements EventSubscriberInterfac ]; } - public function __construct() - { - $this->eventStack = []; - } - public function onGetAvailableAttributes(GetAvailableAttributesEvent $event) { $event->addAttributes($this->getNewAttributes()); @@ -34,6 +29,7 @@ abstract class AbstractGetAttributeSubscriber implements EventSubscriberInterfac public function onGetAttributeEvent(GetAttributeEvent $event) { try { + dump($this->getNewAttributes()); array_push($this->eventStack, $event); $attributeName = $event->getAttributeName(); -- GitLab