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

bug: PHP-DI doesn't support factories with magic methods #67

Open
defaultpage opened this issue Aug 10, 2021 · 1 comment
Open

bug: PHP-DI doesn't support factories with magic methods #67

defaultpage opened this issue Aug 10, 2021 · 1 comment
Labels
type: bug Something isn't working

Comments

@defaultpage
Copy link

defaultpage commented Aug 10, 2021

Describe the bug
If someone uses mezzio + PHP-DI, they will receive an error MessageBusFactory::messenger.command.bus() is not a callable. A __call() or __callStatic() method exists but magic methods are not supported.

PHP-DI uses PHP-DI/Invoker.

To Reproduce
Steps to reproduce the behavior:

  1. Create project of Mezzio with PHP-DI container
  2. Add current library into the project
  3. Try to dispatch a command
  4. See error

Version of the xtreamwayz/psr-container-messenger library
2.5.0

Expected behavior
Command successfully dispatched.

How to fix it for yourself
Use custom configuration entries for the factories or custom ConfigProvider

@defaultpage defaultpage changed the title bug: PHP-DI and PHP-DI/Invoker doesn't support factories with magic methods bug: PHP-DI doesn't support factories with magic methods Aug 10, 2021
@geerteltink geerteltink added the type: bug Something isn't working label Aug 11, 2021
@geerteltink
Copy link
Collaborator

Hi @artemmolotov. First of all, it's good to see that mezzio is used with other containers than laminas-servicemanager. To be honest, I have never tried this with something else. This is certainly something that could be improved. I have no idea how to do this yet as the feature that the servicemanager provides makes configuration in such way pretty easy. But I agree that using custom configuration is not a user friendly way to use this library.

If I can ask, how exactly did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants