Completed
Push — master ( 1eb57a...0a7108 )
by Adriano
165:44
created
src/Integracao/ControlPay/Contracts/IntencaoVenda/GetByIdResponse.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,9 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Integracao/ControlPay/Model/Pedido.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -203,8 +203,9 @@  discard block
 block discarded – undo
203 203
      */
204 204
     public function setProdutos($produtos)
205 205
     {
206
-        foreach ($produtos as $produto)
207
-            $this->produtos[] = SerializerHelper::denormalize($produto, Produto::class);
206
+        foreach ($produtos as $produto) {
207
+                    $this->produtos[] = SerializerHelper::denormalize($produto, Produto::class);
208
+        }
208 209
 
209 210
         return $this;
210 211
     }
@@ -441,8 +442,9 @@  discard block
 block discarded – undo
441 442
     {
442 443
         $this->pedidoStatus = $pedidoStatus;
443 444
 
444
-        if(is_array($this->pedidoStatus))
445
-            $this->pedidoStatus = SerializerHelper::denormalize($this->pedidoStatus, PedidoStatus::class);
445
+        if(is_array($this->pedidoStatus)) {
446
+                    $this->pedidoStatus = SerializerHelper::denormalize($this->pedidoStatus, PedidoStatus::class);
447
+        }
446 448
 
447 449
         return $this;
448 450
     }
Please login to merge, or discard this patch.
src/Integracao/ControlPay/Contracts/Pedido/InserirResponse.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,8 +63,9 @@
 block discarded – undo
63 63
     {
64 64
         $this->pedido = $pedido;
65 65
 
66
-        if(is_array($this->pedido))
67
-            $this->pedido = SerializerHelper::denormalize($this->pedido, Pedido::class);
66
+        if(is_array($this->pedido)) {
67
+                    $this->pedido = SerializerHelper::denormalize($this->pedido, Pedido::class);
68
+        }
68 69
 
69 70
         return $this;
70 71
     }
Please login to merge, or discard this patch.
src/Integracao/ControlPay/Contracts/Pedido/GetByFiltrosResponse.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,8 +66,9 @@
 block discarded – undo
66 66
      */
67 67
     public function setPedidos($pedidos)
68 68
     {
69
-        foreach ($pedidos as $pedido)
70
-            $this->pedidos[] = SerializerHelper::denormalize($pedido, Pedido::class);
69
+        foreach ($pedidos as $pedido) {
70
+                    $this->pedidos[] = SerializerHelper::denormalize($pedido, Pedido::class);
71
+        }
71 72
 
72 73
         return $this;
73 74
     }
Please login to merge, or discard this patch.
src/Integracao/ControlPay/Factory/AuthenticationFactory.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@
 block discarded – undo
21 21
      */
22 22
     public static function getInstance(array $params, Client $client = null)
23 23
     {
24
-        if(!isset($params[ControlPayParameterConst::CONTROLPAY_OAUTH_TYPE]))
25
-            throw new \Exception("Tipo de autenticação não especificado");
24
+        if(!isset($params[ControlPayParameterConst::CONTROLPAY_OAUTH_TYPE])) {
25
+                    throw new \Exception("Tipo de autenticação não especificado");
26
+        }
26 27
 
27 28
         switch ($params[ControlPayParameterConst::CONTROLPAY_OAUTH_TYPE])
28 29
         {
Please login to merge, or discard this patch.
src/Integracao/ControlPay/Contracts/Venda/CancelarVendaResponse.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,9 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Integracao/ControlPay/Client.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
         $this->_params[ControlPayParameterConst::CONTROLPAY_OAUTH_TYPE] = KeyQueryStringAuthentication::class;
112 112
 
113 113
 
114
-        if(!is_null($params))
115
-            foreach ($params as $key => $param)
114
+        if(!is_null($params)) {
115
+                    foreach ($params as $key => $param)
116 116
             {
117 117
                 if(!in_array($key, [
118 118
                     ControlPayParameterConst::CONTROLPAY_HOST,
@@ -130,11 +130,13 @@  discard block
 block discarded – undo
130 130
                     ControlPayParameterConst::CONTROLPAY_DEFAULT_SENHA_TECNICA
131 131
                 ]))
132 132
                     throw new \Exception(sprintf("Parâmetro %s inválido", $key));
133
+        }
133 134
             }
134 135
 
135
-        if(!is_null($params) && is_array($params))
136
-            foreach ($params as $key => $value)
136
+        if(!is_null($params) && is_array($params)) {
137
+                    foreach ($params as $key => $value)
137 138
                 $this->_params[$key] = $value;
139
+        }
138 140
 
139 141
         if(is_null($authentication))
140 142
         {
Please login to merge, or discard this patch.
src/Integracao/ControlPay/API/IntencaoVendaApi.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
                 $this->response->json(),
41 41
                 Contracts\IntencaoVenda\GetByFiltrosResponse::class
42 42
             );
43
-        }catch (RequestException $ex) {
43
+        } catch (RequestException $ex) {
44 44
             $this->requestException($ex);
45
-        }catch (\Exception $ex){
45
+        } catch (\Exception $ex){
46 46
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
47 47
         }
48 48
     }
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
                 $this->response->json(),
66 66
                 Contracts\IntencaoVenda\GetByIdResponse::class
67 67
             );
68
-        }catch (RequestException $ex) {
68
+        } catch (RequestException $ex) {
69 69
             $this->requestException($ex);
70
-        }catch (\Exception $ex){
70
+        } catch (\Exception $ex){
71 71
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
72 72
         }
73 73
     }
Please login to merge, or discard this patch.
src/Integracao/ControlPay/API/PedidoApi.php 1 patch
Braces   +15 added lines, -14 removed lines patch added patch discarded remove patch
@@ -34,10 +34,11 @@  discard block
 block discarded – undo
34 34
 
35 35
             foreach ($inserirRequest->getProdutosPedido() as $key => $produto)
36 36
             {
37
-                if(empty($produto->getId()))
38
-                    $inserirRequest->getProdutosPedido()[$key]->setId(
37
+                if(empty($produto->getId())) {
38
+                                    $inserirRequest->getProdutosPedido()[$key]->setId(
39 39
                         $this->_client->getParameter(ControlPayParameterConst::CONTROLPAY_DEFAULT_PRODUTO_ID)
40 40
                     );
41
+                }
41 42
             }
42 43
 
43 44
             $this->response = $this->_httpClient->post(__FUNCTION__,[
@@ -48,9 +49,9 @@  discard block
 block discarded – undo
48 49
                 $this->response->json(),
49 50
                 Pedido\InserirResponse::class
50 51
             );
51
-        }catch (RequestException $ex) {
52
+        } catch (RequestException $ex) {
52 53
             $this->requestException($ex);
53
-        }catch (\Exception $ex){
54
+        } catch (\Exception $ex){
54 55
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
55 56
         }
56 57
     }
@@ -71,9 +72,9 @@  discard block
 block discarded – undo
71 72
                 $this->response->json(),
72 73
                 Pedido\GetByFiltrosResponse::class
73 74
             );
74
-        }catch (RequestException $ex) {
75
+        } catch (RequestException $ex) {
75 76
             $this->requestException($ex);
76
-        }catch (\Exception $ex){
77
+        } catch (\Exception $ex){
77 78
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
78 79
         }
79 80
     }
@@ -98,9 +99,9 @@  discard block
 block discarded – undo
98 99
                 $this->response->json(),
99 100
                 Pedido\GetByPessoaIdByReferenciaResponse::class
100 101
             );
101
-        }catch (RequestException $ex) {
102
+        } catch (RequestException $ex) {
102 103
             $this->requestException($ex);
103
-        }catch (\Exception $ex){
104
+        } catch (\Exception $ex){
104 105
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
105 106
         }
106 107
     }
@@ -125,9 +126,9 @@  discard block
 block discarded – undo
125 126
                 $this->response->json(),
126 127
                 Pedido\GetByPessoaIdByReferenciaResponse::class
127 128
             );
128
-        }catch (RequestException $ex) {
129
+        } catch (RequestException $ex) {
129 130
             $this->requestException($ex);
130
-        }catch (\Exception $ex){
131
+        } catch (\Exception $ex){
131 132
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
132 133
         }
133 134
     }
@@ -150,9 +151,9 @@  discard block
 block discarded – undo
150 151
                 $this->response->json(),
151 152
                 Pedido\CancelarResponse::class
152 153
             );
153
-        }catch (RequestException $ex) {
154
+        } catch (RequestException $ex) {
154 155
             $this->requestException($ex);
155
-        }catch (\Exception $ex){
156
+        } catch (\Exception $ex){
156 157
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
157 158
         }
158 159
     }
@@ -175,9 +176,9 @@  discard block
 block discarded – undo
175 176
                 $this->response->json(),
176 177
                 Pedido\GetByIdResponse::class
177 178
             );
178
-        }catch (RequestException $ex) {
179
+        } catch (RequestException $ex) {
179 180
             $this->requestException($ex);
180
-        }catch (\Exception $ex){
181
+        } catch (\Exception $ex){
181 182
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
182 183
         }
183 184
     }
Please login to merge, or discard this patch.