@@ -20,7 +20,7 @@ |
||
| 20 | 20 | * @covers JWT::__construct |
| 21 | 21 | */ |
| 22 | 22 | public static function setUpBeforeClass(): void { |
| 23 | - self::$ci =& get_instance(); |
|
| 23 | + self::$ci = & get_instance(); |
|
| 24 | 24 | } |
| 25 | 25 | /** |
| 26 | 26 | * [testLoadPackage description] |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | private $query = []; |
| 12 | 12 | |
| 13 | - function __construct(array $query=null) { |
|
| 13 | + function __construct(array $query = null) { |
|
| 14 | 14 | if ($query != null) { |
| 15 | 15 | foreach ($query as $key => $val) { |
| 16 | 16 | $this->query[$key] = $val; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | function build():string { |
| 33 | 33 | $queryString = '?'; |
| 34 | - foreach($this->query as $key => $val) { |
|
| 34 | + foreach ($this->query as $key => $val) { |
|
| 35 | 35 | $queryString += $key."=".rawurlencode($val)."&"; |
| 36 | 36 | } |
| 37 | 37 | return substr($queryString, 0, strlen($queryString) - 1); |
@@ -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, |