original_string: public function register($event, $callback)
  	{
  		// check if this is a valid event type
  		if ( ! isset($this->callbacks[$event]))
  		{
  			throw new \InvalidArgumentException($event.' is not a valid event');
  		}
  
  		// check if the callback is acually callable
  		if ( ! is_callable($callback))
  		{
  			throw new \InvalidArgumentException('Callback passed is not callable');
  		}
  
  		// store it
  		$this->callbacks[$event][] = $callback;
  	}
code: public function register($event, $callback)
  	{
  		// check if this is a valid event type
  		if ( ! isset($this->callbacks[$event]))
  		{
  			throw new \InvalidArgumentException($event.' is not a valid event');
  		}
  
  		// check if the callback is acually callable
  		if ( ! is_callable($callback))
  		{
  			throw new \InvalidArgumentException('Callback passed is not callable');
  		}
  
  		// store it
  		$this->callbacks[$event][] = $callback;
  	}
code_tokens: public function register ( $ event , $ callback ) { // check if this is a valid event type if ( ! isset ( $ this -> callbacks [ $ event ] ) ) { throw new \ InvalidArgumentException ( $ event . ' is not a valid event' ) ; } // check if the callback is acually callable if ( ! is_callable ( $ callback ) ) { throw new \ InvalidArgumentException ( 'Callback passed is not callable' ) ; } // store it $ this -> callbacks [ $ event ] [ ] = $ callback ; }
docstring: Registers a callback for a given event
  
  @param string $event
  @param mixed  $callback
  
  @throws \InvalidArgumentException if not valid event or not callable second parameter
docstring_tokens: Registers a callback for a given event