src/Events/EventEmitter.php
/**
	 * Removes the callback from the specified event channel, if it exists.
	 *
	 * @param string $channel Event channel.
	 * @param callable $callback Callback function.
	 */
Removes the callback from the specified event channel, if it exists.
@param string $channel Event channel.
@param callable $callback Callback function.
Removes the callback from the specified event channel if it exists . @param string $channel Event channel . @param callable $callback Callback function .
public function remove($channel, callable $callback) {
		$index = -1;
		if (!isset($this->hooks[$channel])) return;
		foreach ($this->hooks[$channel] as $i => $e) {
			if ($e->equals($callback)) {
				$index = $i;
			}
		}
		if ($index >= 0) {
			unset($this->hooks[$channel][$index]);
		}
	}
public function remove ( $ channel , callable $ callback ) { $ index = - 1 ; if ( ! isset ( $ this -> hooks [ $ channel ] ) ) return ; foreach ( $ this -> hooks [ $ channel ] as $ i => $ e ) { if ( $ e -> equals ( $ callback ) ) { $ index = $ i ; } } if ( $ index >= 0 ) { unset ( $ this -> hooks [ $ channel ] [ $ index ] ) ; } }
Removes the callback from the specified event channel, if it exists.
Removes the callback from the specified event channel if it exists .
// Skip if no callbacks exist // Find the index of the callable // Remove the index if found