for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace FondBot\Templates;
use FondBot\Conversation\Template;
class Location implements Template
{
protected $latitude;
protected $longitude;
public function __construct(float $latitude, float $longitude)
$this->latitude = $latitude;
$this->longitude = $longitude;
}
/**
* Get latitude.
*
* @return float
*/
public function getLatitude(): float
return $this->latitude;
* Get longitude.
public function getLongitude(): float
return $this->longitude;
* Get the instance as an array.
* @return array
public function toArray(): array
return [
'latitude' => $this->latitude,
'longitude' => $this->longitude,
];
* Specify data which should be serialized to JSON.
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
* @return mixed data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource.
* @since 5.4.0
public function jsonSerialize(): string
return json_encode($this->toArray());