src/Comely/IO/Events/EventsHandler.php
public function on(string $tag): Event
    {
        // Look for existing Event
        $event = $this->events[$tag] ?? null;
        if ($event) { // Found?
            return $event; // Return existing Event
        }

        // Register and return instance of new Event
        return $this->events[$tag] = new Event($this, $tag);
    }
public function on(string $tag): Event
    {
        // Look for existing Event
        $event = $this->events[$tag] ?? null;
        if ($event) { // Found?
            return $event; // Return existing Event
        }

        // Register and return instance of new Event
        return $this->events[$tag] = new Event($this, $tag);
    }
public function on ( string $ tag ) : Event { // Look for existing Event $ event = $ this -> events [ $ tag ] ?? null ; if ( $ event ) { // Found? return $ event ; // Return existing Event } // Register and return instance of new Event return $ this -> events [ $ tag ] = new Event ( $ this , $ tag ) ; }
Returns a registered Event if exists, otherwise creates a new Event

@param string $tag
@return Event
Returns a registered Event if exists otherwise creates a new Event