@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | private $clientSecret; |
15 | 15 | private $redirectUri = 'urn:ietf:wg:oauth:2.0:oob'; |
16 | 16 | |
17 | - function __construct($params=null) { |
|
17 | + function __construct($params = null) { |
|
18 | 18 | get_instance()->load->splint('francis94c/ci-gmail', '%curl'); |
19 | 19 | if ($params != null) $this->init($params); |
20 | 20 | } |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | * @param string $responseType Response type. 'code' by default. |
39 | 39 | * @return string Authorize URL |
40 | 40 | */ |
41 | - public function getAuthorizeUrl(string $scope, string $redirectUri=null, string $responseType='code', string $accessType='offline'):string { |
|
41 | + public function getAuthorizeUrl(string $scope, string $redirectUri = null, string $responseType = 'code', string $accessType = 'offline'):string { |
|
42 | 42 | $redirectUri = $redirectUri ?? $this->redirectUri; |
43 | 43 | if ($scope == null) throw new Exception("GMail scope cannot be null"); |
44 | - return self::AUTH_URL . build_url_query([ |
|
44 | + return self::AUTH_URL.build_url_query([ |
|
45 | 45 | 'client_id' => $this->clientId, |
46 | 46 | 'redirect_uri' => $redirectUri, |
47 | 47 | 'scope' => $scope, |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | * @param string $code [description] |
55 | 55 | * @return [type] [description] |
56 | 56 | */ |
57 | - public function getToken(string $code, string $redirectUri=null):?array { |
|
57 | + public function getToken(string $code, string $redirectUri = null): ?array { |
|
58 | 58 | $redirectUri = $redirectUri ?? $this->redirectUri; |
59 | 59 | list($code, $result) = (new GMailCURL(GMailCURL::POST))( |
60 | - self::TOKEN_URL . build_url_query([ |
|
60 | + self::TOKEN_URL.build_url_query([ |
|
61 | 61 | 'code' => $code, |
62 | 62 | 'client_id' => $this->clientId, |
63 | 63 | 'client_secret' => $this->clientSecret, |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * [getClientId Get Client ID.] |
77 | 77 | * @return null|string Client ID. |
78 | 78 | */ |
79 | - public function getClientId():?string { |
|
79 | + public function getClientId(): ?string { |
|
80 | 80 | return $this->clientId; |
81 | 81 | } |
82 | 82 | } |