mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Changed latitude and longitude to float
This commit is contained in:
@@ -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 === '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,14 +11,14 @@ final class UnknownVisitLocation implements VisitLocationInterface
|
||||
return 'Unknown';
|
||||
}
|
||||
|
||||
public function getLatitude(): string
|
||||
public function getLatitude(): float
|
||||
{
|
||||
return '0.0';
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
public function getLongitude(): string
|
||||
public function getLongitude(): float
|
||||
{
|
||||
return '0.0';
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
public function getCityName(): string
|
||||
@@ -33,8 +33,8 @@ final class UnknownVisitLocation implements VisitLocationInterface
|
||||
'countryName' => 'Unknown',
|
||||
'regionName' => 'Unknown',
|
||||
'cityName' => 'Unknown',
|
||||
'latitude' => '0.0',
|
||||
'longitude' => '0.0',
|
||||
'latitude' => 0.0,
|
||||
'longitude' => 0.0,
|
||||
'timezone' => 'Unknown',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ interface VisitLocationInterface extends JsonSerializable
|
||||
{
|
||||
public function getCountryName(): string;
|
||||
|
||||
public function getLatitude(): string;
|
||||
public function getLatitude(): float;
|
||||
|
||||
public function getLongitude(): string;
|
||||
public function getLongitude(): float;
|
||||
|
||||
public function getCityName(): string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user