From 7a4b686e2fd51d09748cb27d46b9fe463f13ea3b Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 30 Apr 2020 20:38:49 -0700 Subject: [PATCH] (NFC) CiviEventDispatcher - Improve docblocks --- Civi/Core/CiviEventDispatcher.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Civi/Core/CiviEventDispatcher.php b/Civi/Core/CiviEventDispatcher.php index b5e307dece..18d8aa3043 100644 --- a/Civi/Core/CiviEventDispatcher.php +++ b/Civi/Core/CiviEventDispatcher.php @@ -29,12 +29,22 @@ class CiviEventDispatcher extends ContainerAwareEventDispatcher { private $autoListeners = []; /** + * A list of dispatch-policies (based on an exact-match to the event name). + * + * Note: $dispatchPolicyExact and $dispatchPolicyRegex should coexist; e.g. + * if one is NULL, then both are NULL. If one is an array, then both are arrays. + * * @var array|null * Array(string $eventName => string $action) */ private $dispatchPolicyExact = NULL; /** + * A list of dispatch-policies (based on an regex-match to the event name). + * + * Note: $dispatchPolicyExact and $dispatchPolicyRegex should coexist; e.g. + * if one is NULL, then both are NULL. If one is an array, then both are arrays. + * * @var array|null * Array(string $eventRegex => string $action) */ @@ -155,6 +165,8 @@ class CiviEventDispatcher extends ContainerAwareEventDispatcher { } /** + * Attach any pattern-based listeners which may be interested in $eventName. + * * @param string $eventName * Ex: 'civi.api.resolve' or 'hook_civicrm_dashboard'. */ @@ -174,7 +186,7 @@ class CiviEventDispatcher extends ContainerAwareEventDispatcher { } /** - * The dispatch policy allows you to filter certain events. + * Set the dispatch policy. This allows you to filter certain events. * This can be useful during upgrades or debugging. * * Enforcement will add systemic overhead, so this should normally be NULL. @@ -219,7 +231,10 @@ class CiviEventDispatcher extends ContainerAwareEventDispatcher { // } /** + * Determine whether the dispatch policy applies to a given event. + * * @param string $eventName + * Ex: 'civi.api.resolve' or 'hook_civicrm_dashboard'. * @return string * Ex: 'run', 'drop', 'fail' */ -- 2.25.1