Skip to content

Allow you to configure a client without a factory #257

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

Merged
merged 8 commits into from
Mar 27, 2018
Merged

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Mar 27, 2018

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets
Documentation php-http/documentation#230
License MIT

What's in this PR?

The current way to define clients is:

httplug:
    clients:
        acme:
            factory: 'httplug.factory.guzzle5'

However, If you already have a service you should be able to just "link" that.

httplug:
    clients:
        acme:
            service: 'Buzz\Browser'  # "Buzz\Browser" is a normal service id. 

This will allow you do decorate your custom HTTPlug clients with plugins and other nice things.

Copy link
Collaborator

@dbu dbu left a comment

Choose a reason for hiding this comment

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

very good point, and i love how straightforward this looks. big +1

can you please add something to the changelog and do a PR against the documentation repository as well?

->children()
->scalarNode('factory')
->defaultValue('httplug.factory.auto')
->cannotBeEmpty()
->info('The service id of a factory to use when creating the adapter.')
->end()
->scalarNode('service')
->defaultNull()
->info('The service id of for the client to use.')
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/of for/of/

@Nyholm
Copy link
Member Author

Nyholm commented Mar 27, 2018

Thank you for the review. I updated it accordingly and added a PR to the docs

@Nyholm Nyholm merged commit c91eef5 into master Mar 27, 2018
@Nyholm Nyholm deleted the patch-service branch March 27, 2018 07:08
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.

2 participants