public static function unsubscribe(string $hook, int $hook_reference)
    {
        $parts = explode(".", $hook);
        if (count($parts) < 2)
            throw new InvalidArgumentException("Hook name must consist of at least two parts");

        if (!isset(self::$hooks[$hook]))
            throw new InvalidArgumentException("Hook was not set");

        foreach (self::$hooks[$hook] as $idx => $hook_data)
        {
            if ($hook_data['ref'] === $hook_reference)
            {
                unset(self::$hooks[$hook][$idx]);
                return true;
            }
        }
        return false;
    }
public static function unsubscribe(string $hook, int $hook_reference)
    {
        $parts = explode(".", $hook);
        if (count($parts) < 2)
            throw new InvalidArgumentException("Hook name must consist of at least two parts");

        if (!isset(self::$hooks[$hook]))
            throw new InvalidArgumentException("Hook was not set");

        foreach (self::$hooks[$hook] as $idx => $hook_data)
        {
            if ($hook_data['ref'] === $hook_reference)
            {
                unset(self::$hooks[$hook][$idx]);
                return true;
            }
        }
        return false;
    }
public static function unsubscribe ( string $ hook , int $ hook_reference ) { $ parts = explode ( "." , $ hook ) ; if ( count ( $ parts ) < 2 ) throw new InvalidArgumentException ( "Hook name must consist of at least two parts" ) ; if ( ! isset ( self :: $ hooks [ $ hook ] ) ) throw new InvalidArgumentException ( "Hook was not set" ) ; foreach ( self :: $ hooks [ $ hook ] as $ idx => $ hook_data ) { if ( $ hook_data [ 'ref' ] === $ hook_reference ) { unset ( self :: $ hooks [ $ hook ] [ $ idx ] ) ; return true ; } } return false ; }
Unsubscribe from a hook.

@param string $hook The hook to unsubscribe from
@param int The hook reference
@return bool True when the hook was removed, false if it was not present
Unsubscribe from a hook .