src/Pupcake/Pupcake.php
public function on($event_name, $handler_callback)
    {
        $event = null;
        if (!isset($this->event_queue[$event_name])) {
            $event = new Event($event_name);
            $this->event_queue[$event_name] = $event;
        }

        $event = $this->event_queue[$event_name];
        $event->setHandlerCallback($handler_callback);
    }
public function on($event_name, $handler_callback)
    {
        $event = null;
        if (!isset($this->event_queue[$event_name])) {
            $event = new Event($event_name);
            $this->event_queue[$event_name] = $event;
        }

        $event = $this->event_queue[$event_name];
        $event->setHandlerCallback($handler_callback);
    }
public function on ( $ event_name , $ handler_callback ) { $ event = null ; if ( ! isset ( $ this -> event_queue [ $ event_name ] ) ) { $ event = new Event ( $ event_name ) ; $ this -> event_queue [ $ event_name ] = $ event ; } $ event = $ this -> event_queue [ $ event_name ] ; $ event -> setHandlerCallback ( $ handler_callback ) ; }
add a callback to the event, one event, one handler callback
the handler callback is swappable, so later handler callback can override previous handler callback
add a callback to the event one event one handler callback the handler callback is swappable so later handler callback can override previous handler callback