Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: ability to pass callable to onRest #196

Open
bkdotcom opened this issue Nov 15, 2019 · 1 comment
Open

feature request: ability to pass callable to onRest #196

bkdotcom opened this issue Nov 15, 2019 · 1 comment

Comments

@bkdotcom
Copy link

I realize this library is ancient and not receiving updates, but...

this would be awesome:

$this->onRest(ERestEvent::REQ_AUTH_AJAX_USER, array($handler, 'method'));

It doesn't fail until Eventor::emit() attempts to
$callback = $listener['callback']->bindTo( $this->getBoundObj() );
on the callable array

should only perform the bindTo when $listener['callback'] instanceof Closure

as is, I've ended up with a lot of cruft:

$this->controller->onRest(ERestEvent::REQ_AUTH_AJAX_USER, function () use ($handler) {
    return call_user_func_array(array($handler, method'), func_get_args());
});
@evan108108
Copy link
Owner

Sounds like a great feature please add it and submit a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants