From e63d66aa5dd2fde0ae638f82ac13b64da4c56d77 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Fri, 10 Feb 2023 15:01:56 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B04756=20Fix=20TypeError=20on=20EventData:?= =?UTF-8?q?:$aCallbackData?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/compiler.class.inc.php | 5 ++++- sources/Application/Service/Events/EventData.php | 8 +++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/setup/compiler.class.inc.php b/setup/compiler.class.inc.php index e92209f71..69f24be3a 100644 --- a/setup/compiler.class.inc.php +++ b/setup/compiler.class.inc.php @@ -1394,7 +1394,10 @@ EOF } $sListenerRank = (float)($oListener->GetChildText('rank', '0')); - $sEvents .= "\n Combodo\iTop\Service\Events\EventService::RegisterListener(\"$sEventName\", $sEventListener, \$this->m_sObjectUniqId, \"$sListenerId\", null, $sListenerRank, '$sModuleRelativeDir');"; + $sEvents .= <<m_sObjectUniqId, [], null, $sListenerRank, '$sModuleRelativeDir'); +PHP; } } diff --git a/sources/Application/Service/Events/EventData.php b/sources/Application/Service/Events/EventData.php index 052297504..91f18e5b0 100644 --- a/sources/Application/Service/Events/EventData.php +++ b/sources/Application/Service/Events/EventData.php @@ -20,6 +20,7 @@ class EventData private string $sEvent; private $mEventSource; private array $aEventData; + /** @var array Additional data collected by the listener : they can be set in {@see \Combodo\iTop\Service\Events\EventService::RegisterListener} */ private array $aCallbackData; /** @@ -101,13 +102,10 @@ class EventData } /** - * Get the data associated with the listener. - * The data were passed when registering the listener. - * * @api - * @return mixed The data registered with the listener. + * @uses static::$aCallbackData */ - public function GetCallbackData() + public function GetCallbackData(): array { return $this->aCallbackData; }