@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * config items] |
18 | 18 | * @param array $config Associative Config Array. |
19 | 19 | */ |
20 | - public function init(array $config=null):void { |
|
20 | + public function init(array $config = null):void { |
|
21 | 21 | $this->clientId = $config['client_id'] ?? $this->clientId; |
22 | 22 | } |
23 | 23 | /** |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | * @param string $responseType Response type. 'code' by default. |
30 | 30 | * @return string Authorize URL |
31 | 31 | */ |
32 | - public function getAuthorizeUrl(string $scope, string $redirectUri='urn:ietf:wg:oauth:2.0:oob', string $responseType='code', string $accessType='offline'):string { |
|
32 | + public function getAuthorizeUrl(string $scope, string $redirectUri = 'urn:ietf:wg:oauth:2.0:oob', string $responseType = 'code', string $accessType = 'offline'):string { |
|
33 | 33 | if ($scope == null) throw new Exception("GMail scope cannot be null"); |
34 | - return self::AUTH_URL . new URLQueryBuilder([ |
|
34 | + return self::AUTH_URL.new URLQueryBuilder([ |
|
35 | 35 | 'client_id' => $this->clientId, |
36 | 36 | 'redirect_uri' => $redirectUri, |
37 | 37 | 'scope' => $scope, |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | * @param string $code [description] |
45 | 45 | * @return [type] [description] |
46 | 46 | */ |
47 | - public function getToken(string $code):?array { |
|
47 | + public function getToken(string $code): ?array { |
|
48 | 48 | |
49 | 49 | } |
50 | 50 | /** |
51 | 51 | * [getClientId Get Client ID.] |
52 | 52 | * @return null|string Client ID. |
53 | 53 | */ |
54 | - public function getClientId():?string { |
|
54 | + public function getClientId(): ?string { |
|
55 | 55 | return $this->clientId; |
56 | 56 | } |
57 | 57 | } |
@@ -30,7 +30,9 @@ |
||
30 | 30 | * @return string Authorize URL |
31 | 31 | */ |
32 | 32 | public function getAuthorizeUrl(string $scope, string $redirectUri='urn:ietf:wg:oauth:2.0:oob', string $responseType='code', string $accessType='offline'):string { |
33 | - if ($scope == null) throw new Exception("GMail scope cannot be null"); |
|
33 | + if ($scope == null) { |
|
34 | + throw new Exception("GMail scope cannot be null"); |
|
35 | + } |
|
34 | 36 | return self::AUTH_URL . new URLQueryBuilder([ |
35 | 37 | 'client_id' => $this->clientId, |
36 | 38 | 'redirect_uri' => $redirectUri, |