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;
	}
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;
	}
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 ; }
Registers a callback for a given event

@param string $event
@param mixed  $callback

@throws \InvalidArgumentException if not valid event or not callable second parameter
Registers a callback for a given event