@@ -62,8 +62,9 @@ |
||
| 62 | 62 | { |
| 63 | 63 | $this->intencaoVenda = $intencaoVenda; |
| 64 | 64 | |
| 65 | - if(is_array($this->intencaoVenda)) |
|
| 66 | - $this->intencaoVenda = SerializerHelper::denormalize($this->intencaoVenda, IntencaoVenda::class); |
|
| 65 | + if(is_array($this->intencaoVenda)) { |
|
| 66 | + $this->intencaoVenda = SerializerHelper::denormalize($this->intencaoVenda, IntencaoVenda::class); |
|
| 67 | + } |
|
| 67 | 68 | |
| 68 | 69 | return $this; |
| 69 | 70 | } |
@@ -61,8 +61,9 @@ |
||
| 61 | 61 | public function setIntencoesVendas($intencoesVendas) |
| 62 | 62 | { |
| 63 | 63 | |
| 64 | - foreach ($intencoesVendas as $intencaoVenda) |
|
| 65 | - $this->intencoesVendas[] = SerializerHelper::denormalize($intencaoVenda, IntencaoVenda::class); |
|
| 64 | + foreach ($intencoesVendas as $intencaoVenda) { |
|
| 65 | + $this->intencoesVendas[] = SerializerHelper::denormalize($intencaoVenda, IntencaoVenda::class); |
|
| 66 | + } |
|
| 66 | 67 | |
| 67 | 68 | return $this; |
| 68 | 69 | } |
@@ -44,8 +44,9 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $this->data = \DateTime::createFromFormat('d/m/Y H:i:s.u', $data); |
| 46 | 46 | |
| 47 | - if(!$this->data) |
|
| 48 | - $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 47 | + if(!$this->data) { |
|
| 48 | + $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 49 | + } |
|
| 49 | 50 | |
| 50 | 51 | return $this; |
| 51 | 52 | } |
@@ -65,8 +66,9 @@ discard block |
||
| 65 | 66 | public function setPagamentosExterno($pagamentosExterno) |
| 66 | 67 | { |
| 67 | 68 | |
| 68 | - foreach ($pagamentosExterno as $item) |
|
| 69 | - $this->pagamentosExterno[] = SerializerHelper::denormalize($item, PagamentoExterno::class); |
|
| 69 | + foreach ($pagamentosExterno as $item) { |
|
| 70 | + $this->pagamentosExterno[] = SerializerHelper::denormalize($item, PagamentoExterno::class); |
|
| 71 | + } |
|
| 70 | 72 | |
| 71 | 73 | return $this; |
| 72 | 74 | } |
@@ -45,8 +45,9 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | $this->data = \DateTime::createFromFormat('d/m/Y H:i:s.u', $data); |
| 47 | 47 | |
| 48 | - if(!$this->data) |
|
| 49 | - $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 48 | + if(!$this->data) { |
|
| 49 | + $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 50 | + } |
|
| 50 | 51 | |
| 51 | 52 | return $this; |
| 52 | 53 | } |
@@ -65,8 +66,9 @@ discard block |
||
| 65 | 66 | */ |
| 66 | 67 | public function setTerminais($terminais) |
| 67 | 68 | { |
| 68 | - foreach ($terminais as $item) |
|
| 69 | - $this->terminais[] = SerializerHelper::denormalize($item, Terminal::class); |
|
| 69 | + foreach ($terminais as $item) { |
|
| 70 | + $this->terminais[] = SerializerHelper::denormalize($item, Terminal::class); |
|
| 71 | + } |
|
| 70 | 72 | |
| 71 | 73 | return $this; |
| 72 | 74 | } |
@@ -45,8 +45,9 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | $this->data = \DateTime::createFromFormat('d/m/Y H:i:s.u', $data); |
| 47 | 47 | |
| 48 | - if(!$this->data) |
|
| 49 | - $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 48 | + if(!$this->data) { |
|
| 49 | + $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 50 | + } |
|
| 50 | 51 | |
| 51 | 52 | return $this; |
| 52 | 53 | } |
@@ -67,8 +68,9 @@ discard block |
||
| 67 | 68 | { |
| 68 | 69 | $this->terminal = $terminal; |
| 69 | 70 | |
| 70 | - if(is_array($this->terminal)) |
|
| 71 | - $this->terminal = SerializerHelper::denormalize($this->terminal, Terminal::class); |
|
| 71 | + if(is_array($this->terminal)) { |
|
| 72 | + $this->terminal = SerializerHelper::denormalize($this->terminal, Terminal::class); |
|
| 73 | + } |
|
| 72 | 74 | |
| 73 | 75 | return $this; |
| 74 | 76 | } |
@@ -44,8 +44,9 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $this->data = \DateTime::createFromFormat('d/m/Y H:i:s.u', $data); |
| 46 | 46 | |
| 47 | - if(!$this->data) |
|
| 48 | - $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 47 | + if(!$this->data) { |
|
| 48 | + $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 49 | + } |
|
| 49 | 50 | |
| 50 | 51 | return $this; |
| 51 | 52 | } |
@@ -65,8 +66,9 @@ discard block |
||
| 65 | 66 | public function setProdutos($produtos) |
| 66 | 67 | { |
| 67 | 68 | |
| 68 | - foreach ($produtos as $item) |
|
| 69 | - $this->produtos[] = SerializerHelper::denormalize($item, Produto::class); |
|
| 69 | + foreach ($produtos as $item) { |
|
| 70 | + $this->produtos[] = SerializerHelper::denormalize($item, Produto::class); |
|
| 71 | + } |
|
| 70 | 72 | |
| 71 | 73 | return $this; |
| 72 | 74 | } |
@@ -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()) |