src/Lego/Foundation/Event.php
public function once($event, $listener, \Closure $callback)
    {
        $realListener = $this->register($event, $listener, $callback);

        if (!isset($this->once[$event])) {
            $this->once[$event] = [];
        }
        $this->once[$event][$realListener] = true;

        return $realListener;
    }
public function once($event, $listener, \Closure $callback)
    {
        $realListener = $this->register($event, $listener, $callback);

        if (!isset($this->once[$event])) {
            $this->once[$event] = [];
        }
        $this->once[$event][$realListener] = true;

        return $realListener;
    }
public function once ( $ event , $ listener , \ Closure $ callback ) { $ realListener = $ this -> register ( $ event , $ listener , $ callback ) ; if ( ! isset ( $ this -> once [ $ event ] ) ) { $ this -> once [ $ event ] = [ ] ; } $ this -> once [ $ event ] [ $ realListener ] = true ; return $ realListener ; }
fire only once.
fire only once .