-
Notifications
You must be signed in to change notification settings - Fork 58
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
Arg 2 passed to Sebdesign\SM\Factory\Factory::__construct() must implement interface exception #22
Comments
That's strange. I installed the package (v1.4.0) to a fresh laravel project (v5.8.19), and it works fine. Could you paste the whole stack trace here? Did you try running |
Okay I think I discovered what caused it. The very popular barryvdh/laravel-ide-helper Try installing that package to your require-dev then have the following in your composer.json
Pretty sure Now I'm not sure if you should adapt your package to barryvdh/laravel-ide-helper or barryvdh/laravel-ide-helper should have some code to handle packages like yours. This problem only occured since yesterday if it helps |
The stack trace of
|
I was able to reproduce the error by installing This is quite obscure, but I think it might be related to Symfony 4.3 which has released a few days ago. The interface of the event dispatcher was changed and that probably doesn't play well with laravel-ide-helper. I will investigate more with this and get back to you. |
After some tinkering I found that the Now the In this PR: barryvdh/laravel-ide-helper#779 the If you also comment-out |
So do we make a pull request over there? |
I'm not sure yet, because it seems those changes were recently added and have valid purposes. Also, it seems that in Symfony 4.3 the arguments of the dispatch method have been swapped: symfony/symfony#28920 and the old way is deprecated. This means the I think I will make a PR over there and see how it will go. By for the time being, you can manually alert the code in the ide-helper:meta command manually from your vendor if that's blocking you. |
Thanks! No worries it's not blocking me I could just not call the ide-helper meta docs command or remove this package for now. Given the complaints I got from my current client on how they can't reverse a status they transit to by mistake and would rather have the freedom to set to any status. So the enforcement by a state machine has its cons as well :) May be off topic, just curious but have you tried any of those composer patches packages before in your projects? |
Yeah state machines have their drawbacks too. In that case you could leverage gates/policies to allow for the admin to change any status they want. :) https://github.com/sebdesign/laravel-state-machine#using-gates-and-policies I haven't look into those packages, but I tend to fork dependencies and use vcs repositories in my composer.json sometimes. |
great. Thanks for the tips! |
Hi, I have the same error and it seams winzou/state-machine is not maintained. |
Got this error when I run composer update today. Didn't have this issue yesterday. Yet to make any new changes to my code. Using Laravel 5.8. Hope it helps!
Symfony\Component\Debug\Exception\FatalThrowableError : Argument 2 passed to Sebdesign\SM\Factory\Factory::__construct() must implement interface Symfony\Component\EventDispatcher\EventDispatcherInterface or be null, instance of Sebdesign\SM\Event\Dispatcher given
called in .../vendor/sebdesign/laravel-state-machine/src/ServiceProvider.php on line 73
The text was updated successfully, but these errors were encountered: