Skip to content

Commit 5f3c60b

Browse files
committed
Replaced NULL with EMPTY STRING as response
1 parent fabd685 commit 5f3c60b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Objects/ViaCepResponse.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ public function __construct(int|string $cep)
2424
$response = ViaCep::fromCep($cep);
2525
$this->status = $response["statusText"];
2626
$this->cep = $cep;
27-
$this->complement = array_key_exists("complemento", $response) ? $response["complemento"] : null;
28-
$this->ibge = array_key_exists("ibge", $response) ? $response["ibge"] : null;
29-
$this->gia = array_key_exists("gia", $response) ? $response["gia"] : null;
30-
$this->siafi = array_key_exists("siafi", $response) ? $response["siafi"] : null;
31-
$this->ddd = array_key_exists("ddd", $response) ? $response["ddd"] : null;
32-
$this->street = array_key_exists("logradouro", $response) ? $response["logradouro"] : null;
33-
$this->area = array_key_exists("bairro", $response) ? $response["bairro"] : null;
34-
$this->city = array_key_exists("localidade", $response) ? $response["localidade"] : null;
35-
$this->state = array_key_exists("uf", $response) ? $response["uf"] : null;
27+
$this->complement = array_key_exists("complemento", $response) ? $response["complemento"] : "";
28+
$this->ibge = array_key_exists("ibge", $response) ? $response["ibge"] : "";
29+
$this->gia = array_key_exists("gia", $response) ? $response["gia"] : "";
30+
$this->siafi = array_key_exists("siafi", $response) ? $response["siafi"] : "";
31+
$this->ddd = array_key_exists("ddd", $response) ? $response["ddd"] : "";
32+
$this->street = array_key_exists("logradouro", $response) ? $response["logradouro"] : "";
33+
$this->area = array_key_exists("bairro", $response) ? $response["bairro"] : "";
34+
$this->city = array_key_exists("localidade", $response) ? $response["localidade"] : "";
35+
$this->state = array_key_exists("uf", $response) ? $response["uf"] : "";
3636
$this->country = "BR";
3737
}
3838

0 commit comments

Comments
 (0)