src/Hook/Hook.php
public static function trigger($name, $silent=false) {
		$name = static::slug($name);
		$firstParam = null;
		if( !is_bool($silent) ) {
			$firstParam = $silent;
			$silent = false;// Default
		}
		if( empty(static::$hooks[$name]) ) {
			if( $silent ) { return; }
			throw new \Exception('No hook with this name');
		}
		$params = null;
		if( func_num_args() > 2 ) {
			$params = func_get_args();
			unset($params[0], $params[1]);
			if( isset($firstParam) ) {
				$params[0] = $firstParam;
			}
			$params = array_values($params);
		}
		return static::$hooks[$name]->triggerHook($params);
	}
public static function trigger($name, $silent=false) {
		$name = static::slug($name);
		$firstParam = null;
		if( !is_bool($silent) ) {
			$firstParam = $silent;
			$silent = false;// Default
		}
		if( empty(static::$hooks[$name]) ) {
			if( $silent ) { return; }
			throw new \Exception('No hook with this name');
		}
		$params = null;
		if( func_num_args() > 2 ) {
			$params = func_get_args();
			unset($params[0], $params[1]);
			if( isset($firstParam) ) {
				$params[0] = $firstParam;
			}
			$params = array_values($params);
		}
		return static::$hooks[$name]->triggerHook($params);
	}
public static function trigger ( $ name , $ silent = false ) { $ name = static :: slug ( $ name ) ; $ firstParam = null ; if ( ! is_bool ( $ silent ) ) { $ firstParam = $ silent ; $ silent = false ; // Default } if ( empty ( static :: $ hooks [ $ name ] ) ) { if ( $ silent ) { return ; } throw new \ Exception ( 'No hook with this name' ) ; } $ params = null ; if ( func_num_args ( ) > 2 ) { $ params = func_get_args ( ) ; unset ( $ params [ 0 ] , $ params [ 1 ] ) ; if ( isset ( $ firstParam ) ) { $ params [ 0 ] = $ firstParam ; } $ params = array_values ( $ params ) ; } return static :: $ hooks [ $ name ] -> triggerHook ( $ params ) ; }
Trigger a hook by name

@param string $name The hook name.
@param boolean $silent Make it silent, no exception thrown. Default value is false.
@return The triggerHook() result, usually the first parameter.

Trigger the hook named $name.
e.g trigger('MyHook', true, $parameter1); trigger('MyHook', $parameter1, $parameter2);
We advise to always provide $silent parameters if you pass additional parameters to the callback
Trigger a hook by name