Changed latitude and longitude to float

This commit is contained in:
Alejandro Celaya
2019-12-31 23:37:49 +01:00
parent 0cf1d8d375
commit 0e04968bc2
6 changed files with 24 additions and 34 deletions

View File

@@ -14,8 +14,8 @@ class VisitLocation extends AbstractEntity implements VisitLocationInterface
private string $countryName;
private string $regionName;
private string $cityName;
private string $latitude; // FIXME Should be float
private string $longitude; // FIXME Should be float
private float $latitude;
private float $longitude;
private string $timezone;
public function __construct(Location $location)
@@ -25,22 +25,22 @@ class VisitLocation extends AbstractEntity implements VisitLocationInterface
public function getCountryName(): string
{
return $this->countryName ?? '';
return $this->countryName;
}
public function getLatitude(): string
public function getLatitude(): float
{
return $this->latitude ?? '';
return $this->latitude;
}
public function getLongitude(): string
public function getLongitude(): float
{
return $this->longitude ?? '';
return $this->longitude;
}
public function getCityName(): string
{
return $this->cityName ?? '';
return $this->cityName;
}
private function exchangeLocationInfo(Location $info): void
@@ -49,8 +49,8 @@ class VisitLocation extends AbstractEntity implements VisitLocationInterface
$this->countryName = $info->countryName();
$this->regionName = $info->regionName();
$this->cityName = $info->city();
$this->latitude = (string) $info->latitude();
$this->longitude = (string) $info->longitude();
$this->latitude = $info->latitude();
$this->longitude = $info->longitude();
$this->timezone = $info->timeZone();
}
@@ -74,8 +74,8 @@ class VisitLocation extends AbstractEntity implements VisitLocationInterface
$this->countryName === '' &&
$this->regionName === '' &&
$this->cityName === '' &&
((float) $this->latitude) === 0.0 &&
((float) $this->longitude) === 0.0 &&
$this->latitude === 0.0 &&
$this->longitude === 0.0 &&
$this->timezone === '';
}
}