N°4756 Fix TypeError on EventData::$aCallbackData

This commit is contained in:
Pierre Goiffon
2023-02-10 15:01:56 +01:00
parent 2803f0be49
commit e63d66aa5d
2 changed files with 7 additions and 6 deletions

View File

@@ -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 .= <<<PHP
Combodo\iTop\Service\Events\EventService::RegisterListener("$sEventName", $sEventListener, \$this->m_sObjectUniqId, [], null, $sListenerRank, '$sModuleRelativeDir');
PHP;
}
}

View File

@@ -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;
}