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

Simplify callback arguments? #5

Open
pwFoo opened this issue Dec 31, 2019 · 0 comments
Open

Simplify callback arguments? #5

pwFoo opened this issue Dec 31, 2019 · 0 comments

Comments

@pwFoo
Copy link

pwFoo commented Dec 31, 2019

I don't know if it would be easy to do, but would be great if we don't need to write all the default arguments to a hook?

Would it possible to move the arguments to the class instead to repeat in the users code?

[...] function(&$arguments, $name, &$object, &$function, &$data)

I don't know if possible in that context. but maybe it's possible to inject the original method arguments / data by "use" behind the function () use [...] in Hook.php or build a single object like $event with all the data?

$event->object // original object
$event->arguments() // all arguments
$event->arguments(0) // first argument
$event->arguments('name') // argument by name
[...]
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

1 participant