| @@ -29,7 +29,7 @@ | ||
| 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; | 
| @@ -24,7 +24,7 @@ | ||
| 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 | } | 
| @@ -154,7 +154,7 @@ discard block | ||
| 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 | ||
| 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 | } | 
| @@ -28,7 +28,7 @@ | ||
| 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; | 
| @@ -34,7 +34,7 @@ | ||
| 34 | 34 | |
| 35 | 35 | public function textClear(?string $value, int $count): ?string | 
| 36 | 36 |      { | 
| 37 | -        if(empty($value)){ | |
| 37 | +        if (empty($value)) { | |
| 38 | 38 | return null; | 
| 39 | 39 | } | 
| 40 | 40 | return mb_substr($this->textClearSpecialChar($value), 0, $count); | 
| @@ -19,7 +19,7 @@ | ||
| 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); | 
| @@ -20,7 +20,7 @@ | ||
| 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 | |
| @@ -25,7 +25,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | |
| 140 | 140 | // Add custom method | 
| 141 | 141 | if (in_array($method, [ | 
| @@ -148,7 +148,7 @@ discard block | ||
| 148 | 148 | } | 
| 149 | 149 | |
| 150 | 150 | // Add body params | 
| 151 | -        if (! empty($jsonBody)) { | |
| 151 | +        if (!empty($jsonBody)) { | |
| 152 | 152 | curl_setopt($curl, CURLOPT_POST, 1); | 
| 153 | 153 | curl_setopt($curl, CURLOPT_POSTFIELDS, is_string($jsonBody) ? $jsonBody : json_encode($jsonBody)); | 
| 154 | 154 | } | 
| @@ -178,7 +178,7 @@ discard block | ||
| 178 | 178 | } | 
| 179 | 179 | |
| 180 | 180 | $responseDecode = json_decode($response, true); | 
| 181 | -        if(is_null($responseDecode)){ | |
| 181 | +        if (is_null($responseDecode)) { | |
| 182 | 182 | $responseDecode = ['status_code' => $statusCode]; | 
| 183 | 183 |          } else { | 
| 184 | 184 | array_push($responseDecode, ['status_code' => $statusCode]); |