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

Fix DebugCommand dependency injection #905

Merged
merged 1 commit into from
Nov 22, 2021
Merged

Fix DebugCommand dependency injection #905

merged 1 commit into from
Nov 22, 2021

Conversation

jdecool
Copy link
Contributor

@jdecool jdecool commented Nov 18, 2021

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? no
Documented? no
Fixed tickets N/A
License MIT

In one of our projects, we decorate QueryResolver and MutationResolver for our needs.

But currently, the DebugCommand depends on concrete implementations instead of interfaces.
So when we run the bin/console list, Symfony crash because of the dependency injection.

This PR updates the DebugCommand constructor to inject FluentResolverInterface instead of concrete implementations.

@jdecool jdecool marked this pull request as ready for review November 18, 2021 08:05
@jdecool jdecool changed the base branch from master to 0.13 November 18, 2021 09:12
DebugCommand should depend on interface and not concrete implementation.
@mcg-web
Copy link
Member

mcg-web commented Nov 22, 2021

This change can introduce a break change before php 8, can we introduced this from 0.14 @jdecool ?

@jdecool
Copy link
Contributor Author

jdecool commented Nov 22, 2021

@mcg-web It could.

But I don't understand why it could introduce a BC before PHP 8.
All class used implement the FluentResolverInterface so they can be replaced by the interface they use no ?

@ruudk
Copy link
Contributor

ruudk commented Nov 22, 2021

The class it not final, so it could be extended. But it shouldn't be an issue, see https://3v4l.org/OZ86V

@mcg-web
Copy link
Member

mcg-web commented Nov 22, 2021

My bad since it's the construct , it is not consider as a BC.

@mcg-web mcg-web merged commit 53a2f88 into overblog:0.13 Nov 22, 2021
@jdecool jdecool deleted the fix/debug-command branch November 22, 2021 13:40
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

Successfully merging this pull request may close these issues.

3 participants