saloon
saloon copied to clipboard
Add `Stringable` to OAuthConfig `set` methods.
This PR adds |Stringable
to the set
methods in the OAuthConfig class that accept a string parameter.
In my use case, I'm constructing URLs using the spatie/url package and would like to be able to pass the URL directly to the setAuthorizeEndpoint()
method:
$this->oauthConfig()->setAuthorizeEndpoint(
Url::fromString('https://api.example.com/oauth2/authorize')
->withQueryParameters([
'app_key' => $appKey,
'response_type' => 'code'
])
);
The Url
implements the Stringable
__toString()
method so I can either cast to a string or update Saloon to support Stringable
parameters :smile: