src/PAMI/Client/Impl/ClientImpl.php
protected function dispatch(IncomingMessage $message)
    {
        foreach ($this->eventListeners as $data) {
            $listener = $data[0];
            $predicate = $data[1];
            if (is_callable($predicate) && !call_user_func($predicate, $message)) {
                continue;
            }
            if ($listener instanceof \Closure) {
                $listener($message);
            } elseif (is_array($listener)) {
                $listener[0]->{$listener[1]}($message);
            } else {
                $listener->handle($message);
            }
        }
    }
protected function dispatch(IncomingMessage $message)
    {
        foreach ($this->eventListeners as $data) {
            $listener = $data[0];
            $predicate = $data[1];
            if (is_callable($predicate) && !call_user_func($predicate, $message)) {
                continue;
            }
            if ($listener instanceof \Closure) {
                $listener($message);
            } elseif (is_array($listener)) {
                $listener[0]->{$listener[1]}($message);
            } else {
                $listener->handle($message);
            }
        }
    }
protected function dispatch ( IncomingMessage $ message ) { foreach ( $ this -> eventListeners as $ data ) { $ listener = $ data [ 0 ] ; $ predicate = $ data [ 1 ] ; if ( is_callable ( $ predicate ) && ! call_user_func ( $ predicate , $ message ) ) { continue ; } if ( $ listener instanceof \ Closure ) { $ listener ( $ message ) ; } elseif ( is_array ( $ listener ) ) { $ listener [ 0 ] -> { $ listener [ 1 ] } ( $ message ) ; } else { $ listener -> handle ( $ message ) ; } } }
Dispatchs the incoming message to a handler.

@param \PAMI\Message\IncomingMessage $message Message to dispatch.

@return void
Dispatchs the incoming message to a handler .