Skip to content

ProfileClient overrides other feature clients #206

Closed
@Nyholm

Description

@Nyholm
Q A
Bug? yes
New Feature? no
Version dev-master

Actual Behavior

When HttplugBundle's client "foo" is configured with HttpMethodsClient. If "foo" is used in discovery it will be picked up by third party bundles. If that third party bundle uses the new ClientFactory from php-http/common we will get an error in the ProfileClient since HttpMethodClient is not a HttpClient AND HttpAsyncClient.

Also, even if HttpMethodClient were to implement HttpClient and HttpAsyncClient, the ProfileClient would not implement the features/functions of the HttpMethodClient.

We should reconsider if decorating pattern is feasible here. If that is our only option, we should maybe consider using dynamic proxys for creating the ProfileClient. I made something like that in the CacheBundle


Edit: If we decorate a client with PluginClient we will not expect the functions from MyCustomClient to be available.

However, the PluginClient must accept an HttpClient or an AsyncHttpClient.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions