src/Loops/Misc/EventTrait.php
public function addListener($name, callable $callback) {
        if(!array_key_exists($name, $this->registered_events)) {
            $this->registered_events[$name] = [];
        }

        $this->registered_events[$name][] = $callback;
    }
public function addListener($name, callable $callback) {
        if(!array_key_exists($name, $this->registered_events)) {
            $this->registered_events[$name] = [];
        }

        $this->registered_events[$name][] = $callback;
    }
public function addListener ( $ name , callable $ callback ) { if ( ! array_key_exists ( $ name , $ this -> registered_events ) ) { $ this -> registered_events [ $ name ] = [ ] ; } $ this -> registered_events [ $ name ] [ ] = $ callback ; }
Manually adds a listener

@param string $name The name of the event.
@param callable $callback The callable that will be called if the event is fired.
Manually adds a listener