1 | <?php |
||
11 | class Google extends AbstractProvider |
||
12 | { |
||
13 | use BearerAuthorizationTrait; |
||
14 | |||
15 | /** |
||
16 | * @var string If set, this will be sent to google as the "access_type" parameter. |
||
17 | * @link https://developers.google.com/identity/protocols/OpenIDConnect#authenticationuriparameters |
||
18 | */ |
||
19 | protected $accessType; |
||
20 | |||
21 | /** |
||
22 | * @var string Comma-separated list of domains or domain regular expressions. |
||
23 | * If only one regular value is passed, it will be sent to google as the "hd" parameter. |
||
24 | * @link https://developers.google.com/identity/protocols/OpenIDConnect#authenticationuriparameters |
||
25 | */ |
||
26 | protected $hostedDomain; |
||
27 | |||
28 | /** |
||
29 | * @var string If set, this will be sent to google as the "prompt" parameter. |
||
30 | * @link https://developers.google.com/identity/protocols/OpenIDConnect#authenticationuriparameters |
||
31 | */ |
||
32 | protected $prompt; |
||
33 | |||
34 | /** |
||
35 | * @var array List of scopes that will be used for authentication. |
||
36 | * @link https://developers.google.com/identity/protocols/googlescopes |
||
37 | */ |
||
38 | protected $scopes = []; |
||
39 | |||
40 | public function getBaseAuthorizationUrl() |
||
44 | |||
45 | public function getBaseAccessTokenUrl(array $params) |
||
49 | |||
50 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
||
54 | |||
55 | protected function getAuthorizationParameters(array $options) |
||
86 | |||
87 | protected function getDefaultScopes() |
||
96 | |||
97 | protected function getScopeSeparator() |
||
101 | |||
102 | protected function checkResponse(ResponseInterface $response, $data) |
||
120 | |||
121 | protected function createResourceOwner(array $response, AccessToken $token) |
||
129 | |||
130 | protected static function isDomainExpression($str) { |
||
133 | |||
134 | protected function multipleDomains() { |
||
137 | |||
138 | /** |
||
139 | * @throws HostedDomainException If the domain does not match the configured domain. |
||
140 | */ |
||
141 | protected function assertMatchingDomains($hostedDomain) |
||
162 | |||
163 | /** |
||
164 | * @return bool Whether user-originating domain equals or matches $reference. |
||
165 | */ |
||
166 | protected function assertMatchingDomain($reference, $hostedDomain) |
||
183 | } |
||
184 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.