Skip to content

DummyClient should implement HttpClient, HttpAsyncClient #122

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

Closed
wants to merge 1 commit into from
Closed

DummyClient should implement HttpClient, HttpAsyncClient #122

wants to merge 1 commit into from

Conversation

mekras
Copy link
Contributor

@mekras mekras commented Sep 12, 2016

Q A
Bug fix? not sure
New feature? no
BC breaks? no
Deprecations? no
License MIT

What's in this PR?

Some IDEs use Symfony container for static analysis and code autocomplete. But DummyClient does not provide any methods. Because of this, IDE shows errors:

IDE shows error

This PR adds to DummyClient dummy implementation of HttpClient and HttpAsyncClient to fix IDE behavior.

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
  • Documentation pull request created (if not simply a bugfix)

This allow static analysis and code autocomplete in IDEs.
@Nyholm
Copy link
Member

Nyholm commented Sep 12, 2016

Thank you! I agree, it should implement HttpClient, even though it is never used.

@sagikazarmark
Copy link
Member

Actually: is this class necessary? Can't we just use an interface in the class parameter of the service definition?

@Nyholm
Copy link
Member

Nyholm commented Sep 12, 2016

It definitely has to be something. Im not sure if you can use an interface. However, what interface do we have that implements both HttpClient and HttpAsyncClient?

@dbu
Copy link
Collaborator

dbu commented Sep 12, 2016

i am pretty sure an interface would work in the class parameter, if it is never actually tried to be instantiated - which would be wrong anyways. we could change the type of DummyClient to interface and then it can implement both interfaces without needing to add empty methods. and it can't be accidentally implemented.

@Nyholm
Copy link
Member

Nyholm commented Sep 12, 2016

We could change the type of DummyClient to interface and then it can implement both interfaces without needing to add empty methods. and it can't be accidentally implemented.

👍 @mekras, can you try that?

@mekras
Copy link
Contributor Author

mekras commented Sep 12, 2016

@Nyholm, why not? But not now. May be later today.

@mekras mekras closed this Sep 12, 2016
@mekras mekras deleted the dummy_client_methods branch September 12, 2016 18:00
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.

4 participants