Updated Location
This commit is contained in:
parent
115379e5ab
commit
b2c8877294
1 changed files with 14 additions and 38 deletions
|
@ -7,35 +7,12 @@
|
||||||
|
|
||||||
class Location implements ObjectTypeInterface
|
class Location implements ObjectTypeInterface
|
||||||
{
|
{
|
||||||
/**
|
private float $longitude;
|
||||||
* @var float
|
private float $latitude;
|
||||||
*/
|
private int|null|float $horizontal_accuracy;
|
||||||
private $longitude;
|
private ?int $live_period;
|
||||||
|
private ?int $heading;
|
||||||
/**
|
private ?int $proximity_alert_radius;
|
||||||
* @var float
|
|
||||||
*/
|
|
||||||
private $latitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var float|int|null
|
|
||||||
*/
|
|
||||||
private $horizontal_accuracy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var int|null
|
|
||||||
*/
|
|
||||||
private $live_period;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var int|null
|
|
||||||
*/
|
|
||||||
private $heading;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var int|null
|
|
||||||
*/
|
|
||||||
private $proximity_alert_radius;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Longitude as defined by sender
|
* Longitude as defined by sender
|
||||||
|
@ -100,9 +77,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array representation of the object.
|
* @inheritDoc
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public function toArray(): array
|
public function toArray(): array
|
||||||
{
|
{
|
||||||
|
@ -117,15 +92,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an object from an array representation.
|
* @inheritDoc
|
||||||
*
|
|
||||||
* @param array $data
|
|
||||||
* @return Location
|
|
||||||
*/
|
*/
|
||||||
public static function fromArray(array $data): self
|
public static function fromArray(?array $data): ?Location
|
||||||
{
|
{
|
||||||
$object = new self();
|
if($data === null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$object = new self();
|
||||||
$object->longitude = $data['longitude'] ?? null;
|
$object->longitude = $data['longitude'] ?? null;
|
||||||
$object->latitude = $data['latitude'] ?? null;
|
$object->latitude = $data['latitude'] ?? null;
|
||||||
$object->horizontal_accuracy = $data['horizontal_accuracy'] ?? null;
|
$object->horizontal_accuracy = $data['horizontal_accuracy'] ?? null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue