joomla-framework
joomla-framework copied to clipboard
Google Package
In the Google Class Constructor, the OAuth2 Class is instantiated (if not injected).
It appears the second parameter, that being "the client", is missing from the injected constructor parameters.
From Google Class:
$this->auth = isset($auth) ? $auth : new Auth\OAuth2($this->options);
From OAuth2 Class
public function __construct(Registry $options, Client $client)
Is this a problem? If so, I'd be happy to fix it but would appreciate a hint about what the client should be and how to construct that class.
Thanks!
Good catch, it is a bug, for sure. The Client
is a Joomla\OAuth2\Client
. It's constructor can be found here: https://github.com/joomla/joomla-framework/blob/staging/src/Joomla/OAuth2/Client.php#L56
I think the better solution would be to mandate passing in a properly configured Auth\OAuth2
instance, as there is a lot of configuration needed for a OAuth2\Client
to be instantiated. I don't see this as a BC break, as it doesn't even work currently, since Client
is non-optional, and we aren't passing it in.