Skip to content

Commit

Permalink
[FIX] Boolean values always return true
Browse files Browse the repository at this point in the history
When casting Strings to Bools, PHP will consider any non empty string as true, so `”false”` is actually `true`.
  • Loading branch information
Flerex committed Apr 23, 2021
1 parent bae1dc6 commit 2d155df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/QueryBuilders/StationDetailsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ private function jsonObjectToDto(stdClass $jsonObject): GasStation
$station->bioethanolPercentage = $jsonObject->estacion->porcBioetanol;
$station->bioalcoholPercentage = $jsonObject->estacion->porcBioalcohol;

$station->hasCarWash = $jsonObject->estacion->servicios->lavado;
$station->hasWaterAir = $jsonObject->estacion->servicios->aguaAire;
$station->hasStore = $jsonObject->estacion->servicios->tienda;
$station->hasCoffeeShop = $jsonObject->estacion->servicios->cafeteria;
$station->hasCarWash = $jsonObject->estacion->servicios->lavado == "true";
$station->hasWaterAir = $jsonObject->estacion->servicios->aguaAire == "true";
$station->hasStore = $jsonObject->estacion->servicios->tienda == "true";
$station->hasCoffeeShop = $jsonObject->estacion->servicios->cafeteria == "true";

$station->schedule = $jsonObject->estacion->horario;

Expand Down

0 comments on commit 2d155df

Please sign in to comment.