Passed
Push — main ( dbd039...c99b19 )
by Leandro
02:15
created
src/Itau/API/BaseResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     public function mapperJson($json)
30 30
     {
31 31
         if (is_array($json)) {
32
-            array_walk_recursive($json, function ($value, $key) {
32
+            array_walk_recursive($json, function($value, $key) {
33 33
 
34 34
                 if (property_exists($this, $key)) {
35 35
                     $this->$key = $value;
Please login to merge, or discard this patch.
src/Itau/API/TraitEntity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         $vars = get_object_vars($this);
25 25
 
26 26
         if ($this->hiddenNullValues()) {
27
-            return array_filter($vars, function ($value) {
27
+            return array_filter($vars, function($value) {
28 28
                 return null !== $value;
29 29
             });
30 30
         }
Please login to merge, or discard this patch.
src/Itau/API/Itau.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     public function pix(Pix $pix): PixResponse
155 155
     {
156 156
         $pixResponse = new PixResponse();
157
-        try{
157
+        try {
158 158
             if ($this->debug) {
159 159
                 print $pix->toJSON();
160 160
             }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
     public function boleCode(BoleCode $boleCode): BoleCodeResponse
179 179
     {
180 180
         $boleCodeResponse = new BoleCodeResponse();
181
-        try{
181
+        try {
182 182
             if ($this->debug) {
183 183
                 print $boleCode->toJSON();
184 184
             }
Please login to merge, or discard this patch.
src/Itau/API/BoleCode/DadoBoleto.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         $this->data_emissao = date("Y-m-d");
29 29
     }
30 30
 
31
-    public function setDados(string $valor, string $codigoEspecia,string $numero): self
31
+    public function setDados(string $valor, string $codigoEspecia, string $numero): self
32 32
     {
33 33
         $this->valor_total_titulo = round($valor*100);
34 34
         $this->codigo_especie = $codigoEspecia;
Please login to merge, or discard this patch.
src/Itau/API/BoleCode/TipoPessoa.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     public function setPessoa(string $tipoPessoa, $numero): self
20 20
     {
21 21
         $this->codigo_tipo_pessoa = $tipoPessoa;
22
-        if($this->codigo_tipo_pessoa == self::PESSOA_FISICA){
22
+        if ($this->codigo_tipo_pessoa == self::PESSOA_FISICA) {
23 23
             $this->numero_cadastro_pessoa_fisica = preg_replace("/[^0-9]/", "", $numero);
24 24
         } else {
25 25
             $this->numero_cadastro_nacional_pessoa_juridica = preg_replace("/[^0-9]/", "", $numero);
Please login to merge, or discard this patch.
src/Itau/API/BoleCode/DadosIndividuaisBoleto.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
         $this->numero_nosso_numero = str_pad($nossoNumero, 8, '0', STR_PAD_LEFT);
21 21
         $this->data_vencimento = $dataVencimento;
22 22
         $this->valor_titulo = ($valor*100);
23
-        if(!empty($limitePagamento)){
23
+        if (!empty($limitePagamento)) {
24 24
             $this->data_limite_pagamento = $limitePagamento;
25 25
         }
26 26
         
Please login to merge, or discard this patch.
src/Itau/API/Request.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function __construct(Itau $credentials)
27 27
     {
28
-        if (! $credentials->getAuthorizationToken()) {
28
+        if (!$credentials->getAuthorizationToken()) {
29 29
             $this->auth($credentials);
30 30
         }
31 31
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             ];
87 87
         }
88 88
 
89
-        if (! $response) {
89
+        if (!$response) {
90 90
             throw new ItauException("Empty response, curl_error: $errorMessage", $statusCode);
91 91
         }
92 92
 
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
             CURLOPT_SSL_VERIFYPEER => 0
135 135
         );
136 136
 
137
-        $defaultCurlOptions[CURLOPT_HTTPHEADER][] = 'Authorization: Bearer ' . $credentials->getAuthorizationToken();
138
-        $defaultCurlOptions[CURLOPT_HTTPHEADER][] = 'x-itau-apikey: ' . $credentials->getClientId();
137
+        $defaultCurlOptions[CURLOPT_HTTPHEADER][] = 'Authorization: Bearer '.$credentials->getAuthorizationToken();
138
+        $defaultCurlOptions[CURLOPT_HTTPHEADER][] = 'x-itau-apikey: '.$credentials->getClientId();
139 139
         $defaultCurlOptions[CURLOPT_HTTPHEADER][] = 'x-itau-correlationID: 2';
140 140
 
141 141
         // Add custom method
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         }
150 150
 
151 151
         // Add body params
152
-        if (! empty($jsonBody)) {
152
+        if (!empty($jsonBody)) {
153 153
             curl_setopt($curl, CURLOPT_POST, 1);
154 154
             curl_setopt($curl, CURLOPT_POSTFIELDS, is_string($jsonBody) ? $jsonBody : json_encode($jsonBody));
155 155
         }
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         }
180 180
 
181 181
         $responseDecode = json_decode($response, true);
182
-        if(is_null($responseDecode)){
182
+        if (is_null($responseDecode)) {
183 183
             $responseDecode = ['status_code' => $statusCode];
184 184
         } else {
185 185
             array_push($responseDecode, ['status_code' => $statusCode]);
Please login to merge, or discard this patch.
src/Itau/API/BoleCode/Juros.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
     public function setJuros($codigo, $percentual): self
18 18
     {
19 19
         $this->codigo_tipo_juros = $codigo;
20
-        if($codigo != self::SEM_JUROS){
20
+        if ($codigo != self::SEM_JUROS) {
21 21
             $this->percentual_juros = $percentual*100000;
22 22
         }
23 23
         return $this;
Please login to merge, or discard this patch.
src/Itau/API/BoleCode/Endereco.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 
36 36
     public function textClear(?string $value, int $count): ?string
37 37
     {
38
-        if(empty($value)){
38
+        if (empty($value)) {
39 39
             return null;
40 40
         }
41 41
         return mb_substr(StringHelper::removerAcentos($value), 0, $count);
Please login to merge, or discard this patch.