src/AdvanceEventEmitterTrait.php
public function once(string $eventName, callable $listener) : self
    {
        $onceListener = function (EventInterface $event) use (&$onceListener, $eventName, $listener) {
            $this->removeListener($eventName, $onceListener);

            call_user_func($listener, $event);
        };

        $this->on($eventName, $onceListener);

        return $this;
    }
public function once(string $eventName, callable $listener) : self
    {
        $onceListener = function (EventInterface $event) use (&$onceListener, $eventName, $listener) {
            $this->removeListener($eventName, $onceListener);

            call_user_func($listener, $event);
        };

        $this->on($eventName, $onceListener);

        return $this;
    }
@param string   $eventName
@param callable $listener

@return $this