From 181f15bf7f9497220e8c061bddd49c9389aed8c3 Mon Sep 17 00:00:00 2001 From: Greg Bell Date: Thu, 14 Jun 2018 10:49:14 +1000 Subject: [PATCH 1/3] Clarify comment --- src/Controller/ControllerManager.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Controller/ControllerManager.php b/src/Controller/ControllerManager.php index 20e721655..2fae3e895 100644 --- a/src/Controller/ControllerManager.php +++ b/src/Controller/ControllerManager.php @@ -71,12 +71,15 @@ public function validate($plugin) /** * Initializer: inject EventManager instance * - * If we have an event manager composed already, make sure it gets injected - * with the shared event manager. + * Make sure the event manager gets injected with the shared event manager. * - * The AbstractController lazy-instantiates an EM instance, which is why - * the shared EM injection needs to happen; the conditional will always - * pass. + * The AbstractController lazy-instantiates an EventManager instance, + * which is why the SharedEventManager injection needs to happen; the + * conditional will always pass. + * + * This works because we fetch the EventManager via the container + * (ServiceManager). So it gets built by the EventManagerFactory, + * which injects the SharedEventManager via EventManager's constructor. * * @param ContainerInterface $container * @param DispatchableInterface $controller From c3ec61d2456a8cb94b1055c7a2aad1469e11b917 Mon Sep 17 00:00:00 2001 From: Greg Bell Date: Thu, 14 Jun 2018 10:53:03 +1000 Subject: [PATCH 2/3] Clarify summary comment --- src/Controller/ControllerManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/ControllerManager.php b/src/Controller/ControllerManager.php index 2fae3e895..9f5c11be5 100644 --- a/src/Controller/ControllerManager.php +++ b/src/Controller/ControllerManager.php @@ -71,7 +71,7 @@ public function validate($plugin) /** * Initializer: inject EventManager instance * - * Make sure the event manager gets injected with the shared event manager. + * Set a new event manager injected with the shared event manager. * * The AbstractController lazy-instantiates an EventManager instance, * which is why the SharedEventManager injection needs to happen; the From 6fcfb577d63f5491fb47d9b92f57e7366aed0ce0 Mon Sep 17 00:00:00 2001 From: Greg Bell Date: Thu, 14 Jun 2018 11:09:30 +1000 Subject: [PATCH 3/3] Clarify summary comment --- src/Controller/ControllerManager.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Controller/ControllerManager.php b/src/Controller/ControllerManager.php index 20e721655..9f5c11be5 100644 --- a/src/Controller/ControllerManager.php +++ b/src/Controller/ControllerManager.php @@ -71,12 +71,15 @@ public function validate($plugin) /** * Initializer: inject EventManager instance * - * If we have an event manager composed already, make sure it gets injected - * with the shared event manager. + * Set a new event manager injected with the shared event manager. * - * The AbstractController lazy-instantiates an EM instance, which is why - * the shared EM injection needs to happen; the conditional will always - * pass. + * The AbstractController lazy-instantiates an EventManager instance, + * which is why the SharedEventManager injection needs to happen; the + * conditional will always pass. + * + * This works because we fetch the EventManager via the container + * (ServiceManager). So it gets built by the EventManagerFactory, + * which injects the SharedEventManager via EventManager's constructor. * * @param ContainerInterface $container * @param DispatchableInterface $controller