original_string: 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;
  		}
code: 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;
  		}
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Registers a hook with the application for future interactions .