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

Postpone LoggerPass exception with multiple found LoggerInterfaces to autowire #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

finwe
Copy link
Contributor

@finwe finwe commented Feb 20, 2024

When having multiple implementations of LoggerInterface in the container configuration, I cannot circumvent the Multiple services of type Psr\Log\LoggerInterface found error from LoggerPass even when loggers are explicitly set in the configuration, because the $builder->getByType call throws even before the config condition is processed.

This is a simple attempt to postpone the exception after the config is handled.

I have added the false flag so that the getByType does not throw on the implementation not existing, as this condition is later handled by defaulting to NullLogger. This flag only handles this case, not the case of multiple existing services.

@f3l1x
Copy link
Member

f3l1x commented May 24, 2024

Can you show me your configuration (neon) or create failing test? I am not facing that issue.

@f3l1x
Copy link
Member

f3l1x commented Jul 18, 2024

Ping @finwe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants