diff --git a/setup/compiler.class.inc.php b/setup/compiler.class.inc.php index f0dbda64e..e66f9ad9b 100644 --- a/setup/compiler.class.inc.php +++ b/setup/compiler.class.inc.php @@ -3784,7 +3784,7 @@ EOF; $sEventSource = $aListener['source']; $sContext = $aListener['context']; $sRank = $aListener['rank']; - $sRegister .= "\nCombodo\iTop\Service\Events\EventService::RegisterListener(\"$sEventName\", '$sClassName::$sCallback', $sEventSource, null, $sContext, $sRank, '$sModuleId');"; + $sRegister .= "\nCombodo\iTop\Service\Events\EventService::RegisterListener(\"$sEventName\", '$sClassName::$sCallback', $sEventSource, [], $sContext, $sRank, '$sModuleId');"; $sCallbackFct = $aListener['content']; $sMethods .= "\n $sCallbackFct\n\n"; } diff --git a/sources/Application/Service/Events/EventService.php b/sources/Application/Service/Events/EventService.php index f88d0eac9..877dd9b50 100644 --- a/sources/Application/Service/Events/EventService.php +++ b/sources/Application/Service/Events/EventService.php @@ -64,7 +64,7 @@ final class EventService * @return string Id of the registration * */ - public static function RegisterListener(string $sEvent, callable $callback, $sEventSource = null, $aCallbackData = [], $context = null, float $fPriority = 0.0, $sModuleId = ''): string + public static function RegisterListener(string $sEvent, callable $callback, $sEventSource = null, array $aCallbackData = [], $context = null, float $fPriority = 0.0, $sModuleId = ''): string { if (!is_callable($callback, false, $sName)) { return false;