WebSocket/Runner.php
public function addEvent($event, $callable)
    {
        if (!is_callable($callable)) {
            throw new \InvalidArgumentException(
                sprintf(
                    '%s expects parameter 2 to be callable, %s given: %s',
                    __METHOD__,
                    gettype($callable),
                    print_r($callable, true)
                )
            );
        }

        if (!isset($this->events[$event])) {
            $this->events[$event] = array();
        }

        $this->events[$event][] = $callable;
    }
public function addEvent($event, $callable)
    {
        if (!is_callable($callable)) {
            throw new \InvalidArgumentException(
                sprintf(
                    '%s expects parameter 2 to be callable, %s given: %s',
                    __METHOD__,
                    gettype($callable),
                    print_r($callable, true)
                )
            );
        }

        if (!isset($this->events[$event])) {
            $this->events[$event] = array();
        }

        $this->events[$event][] = $callable;
    }
public function addEvent ( $ event , $ callable ) { if ( ! is_callable ( $ callable ) ) { throw new \ InvalidArgumentException ( sprintf ( '%s expects parameter 2 to be callable, %s given: %s' , __METHOD__ , gettype ( $ callable ) , print_r ( $ callable , true ) ) ) ; } if ( ! isset ( $ this -> events [ $ event ] ) ) { $ this -> events [ $ event ] = array ( ) ; } $ this -> events [ $ event ] [ ] = $ callable ; }
Add an event and its callback

@param string   $event
@param callable $callable
Add an event and its callback