@@ -55,8 +55,9 @@ discard block |
||
| 55 | 55 | $this->endpoint = $endpoint; |
| 56 | 56 | $this->_client = $client; |
| 57 | 57 | |
| 58 | - if(is_null($this->_client)) |
|
| 59 | - $this->_client = new Client(); |
|
| 58 | + if(is_null($this->_client)) { |
|
| 59 | + $this->_client = new Client(); |
|
| 60 | + } |
|
| 60 | 61 | |
| 61 | 62 | $this->query = new GuzzleHttp\Query(); |
| 62 | 63 | $this->query->setEncodingType(false); |
@@ -98,11 +99,13 @@ discard block |
||
| 98 | 99 | { |
| 99 | 100 | $this->query = new GuzzleHttp\Query(); |
| 100 | 101 | |
| 101 | - if(isset($this->_httpClient->getDefaultOption()['query'])) |
|
| 102 | - $this->query = $this->_httpClient->getDefaultOption()['query']; |
|
| 102 | + if(isset($this->_httpClient->getDefaultOption()['query'])) { |
|
| 103 | + $this->query = $this->_httpClient->getDefaultOption()['query']; |
|
| 104 | + } |
|
| 103 | 105 | |
| 104 | - foreach ($params as $key => $value) |
|
| 105 | - $this->query->set($key, $value); |
|
| 106 | + foreach ($params as $key => $value) { |
|
| 107 | + $this->query->set($key, $value); |
|
| 108 | + } |
|
| 106 | 109 | |
| 107 | 110 | return $this->query; |
| 108 | 111 | } |
@@ -47,8 +47,9 @@ |
||
| 47 | 47 | { |
| 48 | 48 | throw new \Exception("Basic authenticanão não é suportado pela api por enquanto"); |
| 49 | 49 | |
| 50 | - if(!empty($this->key)) |
|
| 51 | - return sprintf("Basic %s", $this->key); |
|
| 50 | + if(!empty($this->key)) { |
|
| 51 | + return sprintf("Basic %s", $this->key); |
|
| 52 | + } |
|
| 52 | 53 | |
| 53 | 54 | return sprintf("Basic %s", base64_encode(sprintf("%s:%s", $this->user, $this->password))); |
| 54 | 55 | } |
@@ -52,8 +52,9 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | public function getAuthorization() |
| 54 | 54 | { |
| 55 | - if(!empty($this->key)) |
|
| 56 | - return $this->key; |
|
| 55 | + if(!empty($this->key)) { |
|
| 56 | + return $this->key; |
|
| 57 | + } |
|
| 57 | 58 | |
| 58 | 59 | $response = $this->_loginApi->login( |
| 59 | 60 | (new LoginRequest()) |