public function addListener($trackingId, $callback)
    {
        if (!is_callable($callback)) {
            throw new InvalidArgumentException(sprintf(
                'Second argument to listen() should be callable, but got %s', gettype($callback)
            ));
        }

        $this->getEventDispatcher()->addListener('resource_watcher.'.$trackingId, $callback);
    }
public function addListener($trackingId, $callback)
    {
        if (!is_callable($callback)) {
            throw new InvalidArgumentException(sprintf(
                'Second argument to listen() should be callable, but got %s', gettype($callback)
            ));
        }

        $this->getEventDispatcher()->addListener('resource_watcher.'.$trackingId, $callback);
    }
public function addListener ( $ trackingId , $ callback ) { if ( ! is_callable ( $ callback ) ) { throw new InvalidArgumentException ( sprintf ( 'Second argument to listen() should be callable, but got %s' , gettype ( $ callback ) ) ) ; } $ this -> getEventDispatcher ( ) -> addListener ( 'resource_watcher.' . $ trackingId , $ callback ) ; }
Adds callback as specific tracking listener.

@param string   $trackingId id to this track (used for events naming)
@param callable $callback   callback to call on change

@throws InvalidArgumentException If $callback argument isn't callable
Adds callback as specific tracking listener .