From 810d1833a7e6cab495e4ab5afbe6a546c0d55ca5 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Sat, 7 Dec 2024 17:19:28 +0100 Subject: [PATCH] Fix --- src/Event/BatchActionEvent.php | 8 +------- src/EventListener/ConfigureCRUDControllerListener.php | 7 +++++++ src/Util/AdminObjectAclData.php | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Event/BatchActionEvent.php b/src/Event/BatchActionEvent.php index 6eceea437a..1d61103b3f 100644 --- a/src/Event/BatchActionEvent.php +++ b/src/Event/BatchActionEvent.php @@ -32,11 +32,6 @@ final class BatchActionEvent extends Event { public const TYPE_PRE_BATCH_ACTION = 'pre_batch_action'; - /** - * @var mixed[] - */ - private readonly array $idx; - /** * @param mixed[] $idx * @@ -49,10 +44,9 @@ public function __construct( private readonly string $type, private readonly string $actionName, private readonly ProxyQueryInterface $proxyQuery, - array &$idx, + private array &$idx, private readonly bool $allElements, ) { - $this->idx = &$idx; } /** diff --git a/src/EventListener/ConfigureCRUDControllerListener.php b/src/EventListener/ConfigureCRUDControllerListener.php index cc3179abfc..651cf80245 100644 --- a/src/EventListener/ConfigureCRUDControllerListener.php +++ b/src/EventListener/ConfigureCRUDControllerListener.php @@ -29,6 +29,13 @@ public function onKernelController(ControllerEvent $event): void if (\is_array($controller)) { $controller = $controller[0]; + } else { + try { + $reflection = new \ReflectionFunction($controller(...)); + $controller = $reflection->getClosureThis(); + } catch (\ReflectionException) { + return; + } } if (!$controller instanceof CRUDController) { diff --git a/src/Util/AdminObjectAclData.php b/src/Util/AdminObjectAclData.php index fc969220a3..7f1d5256d9 100644 --- a/src/Util/AdminObjectAclData.php +++ b/src/Util/AdminObjectAclData.php @@ -45,7 +45,7 @@ final class AdminObjectAclData /** * @param AdminInterface $admin * @param \Traversable $aclUsers - * @param \Traversable|null $aclRoles + * @param \Traversable $aclRoles * * @phpstan-param class-string $maskBuilderClass */