-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
BoundMethod::call is broken. #26886
Comments
Where/why are you calling the |
Is this kind of usage documented anywhere or is there any usage in laravel source code like this ?! Anyway I get it, you expect the 'log' to be ignored automatically yes ?! |
Like @dkulyk I was using the container 'call()' to call methods with parameter binding like in 'make/makeWith' (Here), where the given parameters array keys are checked with the reflected parameters names from class constructor to be injected automatically. Actually this behavior still working in BoundMethod as previously expected but the parameter inversion in this commit breaks it. This line in BoundMethod class (153) ensures it: if (array_key_exists($parameter->name, $parameters)) {
$dependencies[] = $parameters[$parameter->name]; |
After updating my Lumen app to include the BoundMethod change, controller injections have stopped working. If I go into BoundMethod.php and revert the changes made here: 881be81#diff-62fd60bbf5999df1027491ff843c6812L119 everything works again. For example I've got a controller method: With this commit, it throws an exception that destroy is expecting an instance of Buckets, but got string. Once reverted, everything works as expected. |
Same here. Spatie's event-projector is broken too because of the parameter inversion mentioned by @gustavofabiane. Related file: https://github.com/spatie/laravel-event-projector/blob/bbac6a7731910f38cb9d5f27961835a12ecd0ef3/src/EventHandlers/HandlesEvents.php#L36 |
Reverted |
Steps To Reproduce:
\Illuminate\Hashing\HashManager
- is an example.Throws exception.
Works if:
$log
exists in function parameters;Related #26852
The text was updated successfully, but these errors were encountered: