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

Extact applyOptions out of the client class #1886

Closed
gmponos opened this issue Jul 26, 2017 · 2 comments
Closed

Extact applyOptions out of the client class #1886

gmponos opened this issue Jul 26, 2017 · 2 comments
Labels
lifecycle/stale No activity for a long time

Comments

@gmponos
Copy link
Member

gmponos commented Jul 26, 2017

Q A
Bug? no
New Feature? yes
Version Specific version or SHA of a commit

Actual Behavior

Hello,

I would like to have a way of converting the RequestOptions of guzzle into a RequestInterface class. At the momemt the function that provides this kind of functionallity is applyOptions which is inside Client class and it's private.

Would you consider extracting this function somewhere else and making it public. Either to a factory class or put it inside functions.php file?

The reason I am making this request is that I need to create a factory that will accept the guzzle options and return a RequestInterface.

So I need

Class GuzzleRequestFactory{

    public function createRequest($method, $uri, $options)
    {
         //return RequestInterface here;
    }
}
@mtdowling
Copy link
Member

Yeah, a factory interface would be great. There was a similar issue here: #1455

An interesting consideration would also be if the implementation for this interface could potentially allow for customizable handling of each request option with the ability to add custom options.

@stale
Copy link

stale bot commented Sep 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you for your contributions.

@stale stale bot added the lifecycle/stale No activity for a long time label Sep 25, 2020
@stale stale bot closed this as completed Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale No activity for a long time
Projects
None yet
Development

No branches or pull requests

2 participants