mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°4756 - Ease extensibility for CRUD operations : Event Service - Fix RegisterListener() signature and calls
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user