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

Plugins #16

Merged
merged 1 commit into from Jan 8, 2016
Merged

Plugins #16

merged 1 commit into from Jan 8, 2016

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Jan 5, 2016

Added plugins with the configuration feature discussed in #15.

$def->setFactory([new Reference($arguments['factory']), 'createClient'])
->addArgument($arguments['config']);

if (empty($arguments['plugins'])) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want this? An alternative could be to send everything to PluginClientFactory so every client is an instance of PluginClient.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would keep it. there is no way to add plugins later at runtime, so it would only be relevant for people that typehint the concrete class instead of the interface, which would be so wrong that we should not care about helping them hide the problem :-)

@dbu
Copy link
Collaborator

dbu commented Jan 6, 2016

👍 thanks tobias!

@Nyholm
Copy link
Member Author

Nyholm commented Jan 6, 2016

Thank you for reviewing this so quickly. I've updated according to your comments.

@Nyholm Nyholm mentioned this pull request Jan 6, 2016
@Nyholm Nyholm force-pushed the plugins branch 2 times, most recently from dfbc6f2 to d02d918 Compare January 6, 2016 15:24
<services>
<service id="httplug.plugin.content_length" class="Http\Client\Plugin\ContentLengthPlugin" public="false" />
<service id="httplug.plugin.decoder" class="Http\Client\Plugin\DecoderPlugin" public="false">
<argument />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is an undefined argument here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that okey since the decoder has a default value there?

Copy link
Collaborator

@dbu dbu Jan 6, 2016 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not have tests that cover this. You are correct that the bundle lacks tests.

@dbu
Copy link
Collaborator

dbu commented Jan 6, 2016

i agree solving plugin configuration in a separate PR. but right now there are two plugin configs with empty tags, i think that will cause problems, no? if we can omit the params we should, otherwise we should remove those plugins for now.

@Nyholm
Copy link
Member Author

Nyholm commented Jan 6, 2016

We can omit those.

Ignore my comment in: #16 (comment)

@Nyholm Nyholm mentioned this pull request Jan 8, 2016
@dbu
Copy link
Collaborator

dbu commented Jan 8, 2016

alright, i think this is ready to merge. @Nyholm can you please squash the commits? feel free to merge, things look good for me.

@Nyholm
Copy link
Member Author

Nyholm commented Jan 8, 2016

Done. I've squashed my commints

dbu added a commit that referenced this pull request Jan 8, 2016
@dbu dbu merged commit 8e3a96e into php-http:master Jan 8, 2016
@dbu
Copy link
Collaborator

dbu commented Jan 8, 2016

great, thanks a lot!

@Nyholm
Copy link
Member Author

Nyholm commented Jan 8, 2016

Thank you for merging.

@Nyholm Nyholm deleted the plugins branch January 8, 2016 08:32
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.

None yet

2 participants