Completed
Push — master ( dc1ac5...ac28ba )
by Adriano
07:48
created
src/Integracao/ControlPay/Model/FormaPagamento.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
     {
113 113
         $this->fluxoPagamento = $fluxoPagamento;
114 114
 
115
-        if(is_array($this->fluxoPagamento))
115
+        if (is_array($this->fluxoPagamento))
116 116
             $this->fluxoPagamento = SerializerHelper::denormalize($this->fluxoPagamento, FluxoPagamento::class);
117 117
 
118 118
         return $this;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,8 +112,9 @@
 block discarded – undo
112 112
     {
113 113
         $this->fluxoPagamento = $fluxoPagamento;
114 114
 
115
-        if(is_array($this->fluxoPagamento))
116
-            $this->fluxoPagamento = SerializerHelper::denormalize($this->fluxoPagamento, FluxoPagamento::class);
115
+        if(is_array($this->fluxoPagamento)) {
116
+                    $this->fluxoPagamento = SerializerHelper::denormalize($this->fluxoPagamento, FluxoPagamento::class);
117
+        }
117 118
 
118 119
         return $this;
119 120
     }
Please login to merge, or discard this patch.
src/Integracao/ControlPay/Model/Produto.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@
 block discarded – undo
221 221
     {
222 222
         $this->produtoStatus = $produtoStatus;
223 223
 
224
-        if(is_array($this->produtoStatus))
224
+        if (is_array($this->produtoStatus))
225 225
             $this->produtoStatus = SerializerHelper::denormalize($this->produtoStatus, ProdutoStatus::class);
226 226
 
227 227
         return $this;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -221,8 +221,9 @@
 block discarded – undo
221 221
     {
222 222
         $this->produtoStatus = $produtoStatus;
223 223
 
224
-        if(is_array($this->produtoStatus))
225
-            $this->produtoStatus = SerializerHelper::denormalize($this->produtoStatus, ProdutoStatus::class);
224
+        if(is_array($this->produtoStatus)) {
225
+                    $this->produtoStatus = SerializerHelper::denormalize($this->produtoStatus, ProdutoStatus::class);
226
+        }
226 227
 
227 228
         return $this;
228 229
     }
Please login to merge, or discard this patch.
src/Integracao/ControlPay/Model/ContaRecebimento.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     {
76 76
         $this->pessoa = $pessoa;
77 77
 
78
-        if(is_array($this->pessoa))
78
+        if (is_array($this->pessoa))
79 79
             $this->pessoa = SerializerHelper::denormalize($pessoa, Pessoa::class);
80 80
 
81 81
         return $this;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
         foreach ($contaRecebimentoLancamentos as $contaRecebimentoLancamento)
136 136
         {
137
-            $this->contaRecebimentoLancamentos[] = SerializerHelper::denormalize(
137
+            $this->contaRecebimentoLancamentos[ ] = SerializerHelper::denormalize(
138 138
                 $contaRecebimentoLancamento, ContaRecebimentoLancamento::class);
139 139
         }
140 140
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,8 +75,9 @@
 block discarded – undo
75 75
     {
76 76
         $this->pessoa = $pessoa;
77 77
 
78
-        if(is_array($this->pessoa))
79
-            $this->pessoa = SerializerHelper::denormalize($pessoa, Pessoa::class);
78
+        if(is_array($this->pessoa)) {
79
+                    $this->pessoa = SerializerHelper::denormalize($pessoa, Pessoa::class);
80
+        }
80 81
 
81 82
         return $this;
82 83
     }
Please login to merge, or discard this patch.
src/Integracao/ControlPay/Model/Pessoa.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -579,7 +579,7 @@
 block discarded – undo
579 579
     public function setDataLogin($dataLogin)
580 580
     {
581 581
         $this->dataLogin = \DateTime::createFromFormat('d/m/Y H:i:s.u', $dataLogin);
582
-       return $this;
582
+        return $this;
583 583
     }
584 584
 
585 585
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -252,7 +252,7 @@
 block discarded – undo
252 252
     {
253 253
         $this->pessoaStatus = $pessoaStatus;
254 254
 
255
-        if(is_array($this->pessoaStatus))
255
+        if (is_array($this->pessoaStatus))
256 256
             $this->pessoaStatus = SerializerHelper::denormalize($this->pessoaStatus, PessoaStatus::class);
257 257
 
258 258
         return $this;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -252,8 +252,9 @@
 block discarded – undo
252 252
     {
253 253
         $this->pessoaStatus = $pessoaStatus;
254 254
 
255
-        if(is_array($this->pessoaStatus))
256
-            $this->pessoaStatus = SerializerHelper::denormalize($this->pessoaStatus, PessoaStatus::class);
255
+        if(is_array($this->pessoaStatus)) {
256
+                    $this->pessoaStatus = SerializerHelper::denormalize($this->pessoaStatus, PessoaStatus::class);
257
+        }
257 258
 
258 259
         return $this;
259 260
     }
Please login to merge, or discard this patch.
src/Integracao/ControlPay/Model/ContaRecebimentoLancamento.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     {
106 106
         $this->contaRecebimento = $contaRecebimento;
107 107
 
108
-        if(is_array($this->contaRecebimento))
108
+        if (is_array($this->contaRecebimento))
109 109
             $this->contaRecebimento = SerializerHelper::denormalize($this->contaRecebimento, ContaRecebimento::class);
110 110
 
111 111
         return $this;
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     {
128 128
         $this->contaPayLancamento = $contaPayLancamento;
129 129
 
130
-        if(is_array($this->contaPayLancamento))
130
+        if (is_array($this->contaPayLancamento))
131 131
             $this->contaPayLancamento = SerializerHelper::denormalize($this->contaPayLancamento, ContaPayLancamento::class);
132 132
 
133 133
         return $this;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     {
150 150
         $this->pagamento = $pagamento;
151 151
 
152
-        if(is_array($this->pagamento))
152
+        if (is_array($this->pagamento))
153 153
             $this->pagamento = SerializerHelper::denormalize($this->pagamento, Pagamento::class);
154 154
 
155 155
         return $this;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     {
172 172
         $this->lancamentoTipo = $lancamentoTipo;
173 173
 
174
-        if(is_array($this->lancamentoTipo))
174
+        if (is_array($this->lancamentoTipo))
175 175
             $this->lancamentoTipo = SerializerHelper::denormalize($this->lancamentoTipo, LancamentoTipo::class);
176 176
 
177 177
         return $this;
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
     {
284 284
         $this->intencaoVenda = $intencaoVenda;
285 285
 
286
-        if(is_array($this->intencaoVenda))
286
+        if (is_array($this->intencaoVenda))
287 287
             $this->intencaoVenda = SerializerHelper::denormalize($this->intencaoVenda, IntencaoVenda::class);
288 288
 
289 289
         return $this;
Please login to merge, or discard this patch.
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -105,8 +105,9 @@  discard block
 block discarded – undo
105 105
     {
106 106
         $this->contaRecebimento = $contaRecebimento;
107 107
 
108
-        if(is_array($this->contaRecebimento))
109
-            $this->contaRecebimento = SerializerHelper::denormalize($this->contaRecebimento, ContaRecebimento::class);
108
+        if(is_array($this->contaRecebimento)) {
109
+                    $this->contaRecebimento = SerializerHelper::denormalize($this->contaRecebimento, ContaRecebimento::class);
110
+        }
110 111
 
111 112
         return $this;
112 113
     }
@@ -127,8 +128,9 @@  discard block
 block discarded – undo
127 128
     {
128 129
         $this->contaPayLancamento = $contaPayLancamento;
129 130
 
130
-        if(is_array($this->contaPayLancamento))
131
-            $this->contaPayLancamento = SerializerHelper::denormalize($this->contaPayLancamento, ContaPayLancamento::class);
131
+        if(is_array($this->contaPayLancamento)) {
132
+                    $this->contaPayLancamento = SerializerHelper::denormalize($this->contaPayLancamento, ContaPayLancamento::class);
133
+        }
132 134
 
133 135
         return $this;
134 136
     }
@@ -149,8 +151,9 @@  discard block
 block discarded – undo
149 151
     {
150 152
         $this->pagamento = $pagamento;
151 153
 
152
-        if(is_array($this->pagamento))
153
-            $this->pagamento = SerializerHelper::denormalize($this->pagamento, Pagamento::class);
154
+        if(is_array($this->pagamento)) {
155
+                    $this->pagamento = SerializerHelper::denormalize($this->pagamento, Pagamento::class);
156
+        }
154 157
 
155 158
         return $this;
156 159
     }
@@ -171,8 +174,9 @@  discard block
 block discarded – undo
171 174
     {
172 175
         $this->lancamentoTipo = $lancamentoTipo;
173 176
 
174
-        if(is_array($this->lancamentoTipo))
175
-            $this->lancamentoTipo = SerializerHelper::denormalize($this->lancamentoTipo, LancamentoTipo::class);
177
+        if(is_array($this->lancamentoTipo)) {
178
+                    $this->lancamentoTipo = SerializerHelper::denormalize($this->lancamentoTipo, LancamentoTipo::class);
179
+        }
176 180
 
177 181
         return $this;
178 182
     }
@@ -283,8 +287,9 @@  discard block
 block discarded – undo
283 287
     {
284 288
         $this->intencaoVenda = $intencaoVenda;
285 289
 
286
-        if(is_array($this->intencaoVenda))
287
-            $this->intencaoVenda = SerializerHelper::denormalize($this->intencaoVenda, IntencaoVenda::class);
290
+        if(is_array($this->intencaoVenda)) {
291
+                    $this->intencaoVenda = SerializerHelper::denormalize($this->intencaoVenda, IntencaoVenda::class);
292
+        }
288 293
 
289 294
         return $this;
290 295
     }
Please login to merge, or discard this patch.
src/Integracao/ControlPay/Helpers/SerializerHelper.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
      */
29 29
     private static function getInstance()
30 30
     {
31
-        if(empty(self::$instance['jms.serializer']))
31
+        if (empty(self::$instance[ 'jms.serializer' ]))
32 32
         {
33
-            self::$instance['jms.serializer'] = SerializerBuilder::create()
33
+            self::$instance[ 'jms.serializer' ] = SerializerBuilder::create()
34 34
                 ->setPropertyNamingStrategy(new SerializedNameAnnotationStrategy(new IdenticalPropertyNamingStrategy()))
35 35
                 ->build();
36 36
         }
37 37
 
38
-        if(empty(self::$instance['symfony.serializer']))
38
+        if (empty(self::$instance[ 'symfony.serializer' ]))
39 39
         {
40
-            self::$instance['symfony.serializer'] = new Serializer([new ObjectNormalizer()],
40
+            self::$instance[ 'symfony.serializer' ] = new Serializer([ new ObjectNormalizer() ],
41 41
                 [
42 42
                     'xml' => new XmlEncoder(),
43 43
                     'json' => new JsonEncoder()
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public static function deserialize($data, $class, $format = 'json')
59 59
     {
60
-        return self::getInstance()['symfony.serializer']->deserialize($data, $class, $format);
60
+        return self::getInstance()[ 'symfony.serializer' ]->deserialize($data, $class, $format);
61 61
     }
62 62
 
63 63
     /**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public static function denormalize($data, $class)
71 71
     {
72
-        return self::getInstance()['symfony.serializer']->denormalize($data, $class);
72
+        return self::getInstance()[ 'symfony.serializer' ]->denormalize($data, $class);
73 73
     }
74 74
 
75 75
     /**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public static function serialize($data, $format = 'json')
81 81
     {
82
-        return self::getInstance()['jms.serializer']->serialize($data, $format);
82
+        return self::getInstance()[ 'jms.serializer' ]->serialize($data, $format);
83 83
     }
84 84
 
85 85
     /**
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public static function toArray($object)
90 90
     {
91
-        return self::getInstance()['jms.serializer']->toArray($object);
91
+        return self::getInstance()[ 'jms.serializer' ]->toArray($object);
92 92
     }
93 93
 
94 94
 }
95 95
\ No newline at end of file
Please login to merge, or discard this patch.
src/Integracao/ControlPay/API/ProdutoApi.php 2 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,10 +41,10 @@
 block discarded – undo
41 41
                 $response->json(),
42 42
                 Contracts\Produto\GetByAtivosByPessoaIdResponse::class
43 43
             );
44
-        }catch (RequestException $ex) {
44
+        } catch (RequestException $ex) {
45 45
             $responseBody = $ex->getResponse()->json();
46 46
             throw new \Exception($responseBody['message']);
47
-        }catch (\Exception $ex){
47
+        } catch (\Exception $ex){
48 48
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
49 49
         }
50 50
     }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function getByAtivosByPessoaId($pessoaId)
32 32
     {
33
-        try{
34
-            $this->response = $this->_httpClient->get(__FUNCTION__,[
33
+        try {
34
+            $this->response = $this->_httpClient->get(__FUNCTION__, [
35 35
                 'query' => $this->addQueryAdditionalParameters([
36 36
                     'pessoaId' => $pessoaId
37 37
                 ])
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
             );
44 44
         }catch (RequestException $ex) {
45 45
             $responseBody = $ex->getResponse()->json();
46
-            throw new \Exception($responseBody['message']);
47
-        }catch (\Exception $ex){
46
+            throw new \Exception($responseBody[ 'message' ]);
47
+        }catch (\Exception $ex) {
48 48
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
49 49
         }
50 50
     }
Please login to merge, or discard this patch.
src/Integracao/ControlPay/API/LoginApi.php 2 patches
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
                 $response->json(),
41 41
                 Contracts\Login\LoginResponse::class
42 42
             );
43
-        }catch (RequestException $ex) {
43
+        } catch (RequestException $ex) {
44 44
             $responseBody = $ex->getResponse()->json();
45 45
             throw new \Exception($responseBody['message']);
46
-        }catch (\Exception $ex){
46
+        } catch (\Exception $ex){
47 47
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
48 48
         }
49 49
     }
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
             $this->_httpClient->post(__FUNCTION__,[]);
59 59
 
60 60
             return true;
61
-        }catch (RequestException $ex) {
61
+        } catch (RequestException $ex) {
62 62
             $responseBody = $ex->getResponse()->json();
63 63
             throw new \Exception($responseBody['message']);
64
-        }catch (\Exception $ex){
64
+        } catch (\Exception $ex){
65 65
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
66 66
         }
67 67
     }
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
                 $response->json(),
83 83
                 Contracts\Login\ConsultaLoginResponse::class
84 84
             );
85
-        }catch (RequestException $ex) {
85
+        } catch (RequestException $ex) {
86 86
             $responseBody = $ex->getResponse()->json();
87 87
             throw new \Exception($responseBody['message']);
88
-        }catch (\Exception $ex){
88
+        } catch (\Exception $ex){
89 89
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
90 90
         }
91 91
     }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function login(Contracts\Login\LoginRequest $loginRequest)
33 33
     {
34
-        try{
35
-            $this->response = $this->_httpClient->post(__FUNCTION__,[
34
+        try {
35
+            $this->response = $this->_httpClient->post(__FUNCTION__, [
36 36
                 'body' => json_encode($loginRequest)
37 37
             ]);
38 38
 
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
             );
43 43
         }catch (RequestException $ex) {
44 44
             $responseBody = $ex->getResponse()->json();
45
-            throw new \Exception($responseBody['message']);
46
-        }catch (\Exception $ex){
45
+            throw new \Exception($responseBody[ 'message' ]);
46
+        }catch (\Exception $ex) {
47 47
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
48 48
         }
49 49
     }
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function logOut()
56 56
     {
57
-        try{
58
-            $this->response = $this->_httpClient->post(__FUNCTION__,[]);
57
+        try {
58
+            $this->response = $this->_httpClient->post(__FUNCTION__, [ ]);
59 59
 
60 60
             return true;
61 61
         }catch (RequestException $ex) {
62 62
             $responseBody = $ex->getResponse()->json();
63
-            throw new \Exception($responseBody['message']);
64
-        }catch (\Exception $ex){
63
+            throw new \Exception($responseBody[ 'message' ]);
64
+        }catch (\Exception $ex) {
65 65
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
66 66
         }
67 67
     }
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
      */
74 74
     public function consultaLogin(Contracts\Login\ConsultaLoginRequest $consultaLoginRequest)
75 75
     {
76
-        try{
77
-            $this->response = $this->_httpClient->post(__FUNCTION__,[
76
+        try {
77
+            $this->response = $this->_httpClient->post(__FUNCTION__, [
78 78
                 'body' => json_encode($consultaLoginRequest)
79 79
             ]);
80 80
 
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
             );
85 85
         }catch (RequestException $ex) {
86 86
             $responseBody = $ex->getResponse()->json();
87
-            throw new \Exception($responseBody['message']);
88
-        }catch (\Exception $ex){
87
+            throw new \Exception($responseBody[ 'message' ]);
88
+        }catch (\Exception $ex) {
89 89
             throw new \Exception($ex->getMessage(), $ex->getCode(), $ex);
90 90
         }
91 91
     }
Please login to merge, or discard this patch.
src/Integracao/ControlPay/Client.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function getParameter($key)
72 72
     {
73
-        return isset($this->_params[$key]) ? $this->_params[$key] : null;
73
+        return isset($this->_params[ $key ]) ? $this->_params[ $key ] : null;
74 74
     }
75 75
 
76 76
     /**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function setParameter($key, $value)
84 84
     {
85
-        $this->_params[$key] = $value;
85
+        $this->_params[ $key ] = $value;
86 86
         $this->loadParameters($this->_params, $this->authentication);
87 87
         return $this;
88 88
     }
@@ -96,17 +96,17 @@  discard block
 block discarded – undo
96 96
      */
97 97
     private function loadParameters($params, IAuthentication $authentication = null)
98 98
     {
99
-        $this->_params[ControlPayParameter::CONTROLPAY_HOST] = getenv('CONTROLPAY_HOST');
100
-        $this->_params[ControlPayParameter::CONTROLPAY_TIMEOUT] = getenv('CONTROLPAY_TIMEOUT');
101
-        $this->_params[ControlPayParameter::CONTROLPAY_USER] = getenv('CONTROLPAY_USER');
102
-        $this->_params[ControlPayParameter::CONTROLPAY_PWD] = getenv('CONTROLPAY_PWD');
103
-        $this->_params[ControlPayParameter::CONTROLPAY_KEY] = getenv('CONTROLPAY_KEY');
104
-        $this->_params[ControlPayParameter::CONTROLPAY_OAUTH_TYPE] = KeyQueryStringAuthentication::class;
105
-
106
-        if(!is_null($params))
99
+        $this->_params[ ControlPayParameter::CONTROLPAY_HOST ] = getenv('CONTROLPAY_HOST');
100
+        $this->_params[ ControlPayParameter::CONTROLPAY_TIMEOUT ] = getenv('CONTROLPAY_TIMEOUT');
101
+        $this->_params[ ControlPayParameter::CONTROLPAY_USER ] = getenv('CONTROLPAY_USER');
102
+        $this->_params[ ControlPayParameter::CONTROLPAY_PWD ] = getenv('CONTROLPAY_PWD');
103
+        $this->_params[ ControlPayParameter::CONTROLPAY_KEY ] = getenv('CONTROLPAY_KEY');
104
+        $this->_params[ ControlPayParameter::CONTROLPAY_OAUTH_TYPE ] = KeyQueryStringAuthentication::class;
105
+
106
+        if (!is_null($params))
107 107
             foreach ($params as $key => $param)
108 108
             {
109
-                if(!in_array($key, [
109
+                if (!in_array($key, [
110 110
                     ControlPayParameter::CONTROLPAY_HOST,
111 111
                     ControlPayParameter::CONTROLPAY_TIMEOUT,
112 112
                     ControlPayParameter::CONTROLPAY_USER,
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
                     throw new \Exception(sprintf("Parâmetro %s inválido", $key));
118 118
             }
119 119
 
120
-        if(!is_null($params) && is_array($params))
120
+        if (!is_null($params) && is_array($params))
121 121
             foreach ($params as $key => $value)
122
-                $this->_params[$key] = $value;
122
+                $this->_params[ $key ] = $value;
123 123
 
124
-        if(is_null($authentication))
124
+        if (is_null($authentication))
125 125
         {
126 126
             $this->authentication = AuthenticationFactory::getInstance($this->_params, $this);
127 127
             return;
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
         $this->_params[ControlPayParameter::CONTROLPAY_KEY] = getenv('CONTROLPAY_KEY');
104 104
         $this->_params[ControlPayParameter::CONTROLPAY_OAUTH_TYPE] = KeyQueryStringAuthentication::class;
105 105
 
106
-        if(!is_null($params))
107
-            foreach ($params as $key => $param)
106
+        if(!is_null($params)) {
107
+                    foreach ($params as $key => $param)
108 108
             {
109 109
                 if(!in_array($key, [
110 110
                     ControlPayParameter::CONTROLPAY_HOST,
@@ -115,11 +115,13 @@  discard block
 block discarded – undo
115 115
                     ControlPayParameter::CONTROLPAY_OAUTH_TYPE
116 116
                 ]))
117 117
                     throw new \Exception(sprintf("Parâmetro %s inválido", $key));
118
+        }
118 119
             }
119 120
 
120
-        if(!is_null($params) && is_array($params))
121
-            foreach ($params as $key => $value)
121
+        if(!is_null($params) && is_array($params)) {
122
+                    foreach ($params as $key => $value)
122 123
                 $this->_params[$key] = $value;
124
+        }
123 125
 
124 126
         if(is_null($authentication))
125 127
         {
Please login to merge, or discard this patch.