@@ -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] |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * config items] |
| 17 | 17 | * @param array $config Associative Config Array. |
| 18 | 18 | */ |
| 19 | - public function init(array $config=null):void { |
|
| 19 | + public function init(array $config = null):void { |
|
| 20 | 20 | $this->clientId = $config['client_id'] ?? $this->clientId; |
| 21 | 21 | } |
| 22 | 22 | /** |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * @param string $responseType Response type. 'code' by default. |
| 29 | 29 | * @return string Authorize URL |
| 30 | 30 | */ |
| 31 | - public function getAuthorizeUrl(string $scope, string $redirectUri='urn:ietf:wg:oauth:2.0:oob', string $responseType='code', string $accessType='offline'):string { |
|
| 31 | + public function getAuthorizeUrl(string $scope, string $redirectUri = 'urn:ietf:wg:oauth:2.0:oob', string $responseType = 'code', string $accessType = 'offline'):string { |
|
| 32 | 32 | if ($scope == null) throw new Exception("GMail scope cannot be null"); |
| 33 | 33 | return self::AUTH_URL."?client_id=$this->clientId&redirect_uri=$redirectUri&scope=$scope&response_type=$responseType&access_type=$accessType"; |
| 34 | 34 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * [getClientId Get Client ID.] |
| 37 | 37 | * @return null|string Client ID. |
| 38 | 38 | */ |
| 39 | - public function getClientId():?string { |
|
| 39 | + public function getClientId(): ?string { |
|
| 40 | 40 | return $this->clientId; |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -29,7 +29,9 @@ |
||
| 29 | 29 | * @return string Authorize URL |
| 30 | 30 | */ |
| 31 | 31 | public function getAuthorizeUrl(string $scope, string $redirectUri='urn:ietf:wg:oauth:2.0:oob', string $responseType='code', string $accessType='offline'):string { |
| 32 | - if ($scope == null) throw new Exception("GMail scope cannot be null"); |
|
| 32 | + if ($scope == null) { |
|
| 33 | + throw new Exception("GMail scope cannot be null"); |
|
| 34 | + } |
|
| 33 | 35 | return self::AUTH_URL."?client_id=$this->clientId&redirect_uri=$redirectUri&scope=$scope&response_type=$responseType&access_type=$accessType"; |
| 34 | 36 | } |
| 35 | 37 | /** |
@@ -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); |