src/Events/EventEmitter.php
/**
	 * Cleans the specified channel of inactive callbacks.
	 */
Cleans the specified channel of inactive callbacks.
Cleans the specified channel of inactive callbacks .
private function clean($channel) {
		if (!isset($this->hooks[$channel])) return;
		for ($i = (count($this->hooks[$channel]) - 1); $i >= 0; $i--) {
			$callback = $this->hooks[$channel][$i];
			if (!$callback || !$callback->getActive()) {
				unset($this->hooks[$channel][$i]);
			}
		}
	}
private function clean ( $ channel ) { if ( ! isset ( $ this -> hooks [ $ channel ] ) ) return ; for ( $ i = ( count ( $ this -> hooks [ $ channel ] ) - 1 ) ; $ i >= 0 ; $ i -- ) { $ callback = $ this -> hooks [ $ channel ] [ $ i ] ; if ( ! $ callback || ! $ callback -> getActive ( ) ) { unset ( $ this -> hooks [ $ channel ] [ $ i ] ) ; } } }
Cleans the specified channel of inactive callbacks.
Cleans the specified channel of inactive callbacks .
// Skip if no callbacks exist // Reverse iterate over callbacks // Get the callback object // Delete it from the array if inactive