Hi there,
unfortunately the search doesn't work on the forums atm, so sorry if this question has already been asked...
I'm looking for a way to write something like this in Zephir:
public function once($event, callable $listener)
{
$onceListener = function () use (&$onceListener, $event, $listener) {
$this->removeListener($event, $onceListener);
call_user_func_array($listener, func_get_args());
};
$this->on($event, $onceListener);
}
(It's basically a Zephir port of igorw/evenement)
Any advice is welcome!