public function registerHook ($key, Hook $hook)
		{
			if (isset($this->hooks[$key])) {
				throw new ReregisterHookException('Attempt to re-register hook ' . $key);
			}

			if (! $key || ! is_string($key)) {
				throw new InvalidHookIdentifierException('Invalid hook identifier ' . var_export($key, true));
			}

			$this->hooks[$key] = $hook;
		}
public function registerHook ($key, Hook $hook)
		{
			if (isset($this->hooks[$key])) {
				throw new ReregisterHookException('Attempt to re-register hook ' . $key);
			}

			if (! $key || ! is_string($key)) {
				throw new InvalidHookIdentifierException('Invalid hook identifier ' . var_export($key, true));
			}

			$this->hooks[$key] = $hook;
		}
public function registerHook ( $ key , Hook $ hook ) { if ( isset ( $ this -> hooks [ $ key ] ) ) { throw new ReregisterHookException ( 'Attempt to re-register hook ' . $ key ) ; } if ( ! $ key || ! is_string ( $ key ) ) { throw new InvalidHookIdentifierException ( 'Invalid hook identifier ' . var_export ( $ key , true ) ) ; } $ this -> hooks [ $ key ] = $ hook ; }
Registers a hook with the application for future interactions.

@see Hook
@api

@param string $key  String identifier for hook used in subsequent calls to bindHook() and triggerHook().
@param Hook   $hook The hook to be registered.

@throws InvalidHookIdentifierException
@throws ReregisterHookException
Registers a hook with the application for future interactions .