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

Closures vs callable #64

Open
edhaase opened this issue Jun 11, 2016 · 2 comments
Open

Closures vs callable #64

edhaase opened this issue Jun 11, 2016 · 2 comments

Comments

@edhaase
Copy link

edhaase commented Jun 11, 2016

I was wondering if there was a particular reason why you're type hinting to \Closure instead of the less restrictive \Callable?

@NeoVance
Copy link
Contributor

There was no implementation for handling callable arrays [$object, "funcName"]. Basically, the author wanted to call the function directly rather than use call_user_func.

It would be a simple change to implement, but at the same time it is also very simple to pass in an anonymous function that calls whatever other functions you want.

@HarryR
Copy link

HarryR commented Sep 3, 2016

I agree, using call_user_func would be better, e.g. being able to do: must('file_exists')

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

3 participants