<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class Coordinates implements \JsonSerializable { private $latitude; private $longitude; public function getLatitude(): ?float { return $this->latitude; } public function setLatitude(?float $latitude): void { $this->latitude = $latitude; } public function getLongitude(): ?float { return $this->longitude; } public function setLongitude(?float $longitude): void { $this->longitude = $longitude; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->latitude)) { $json['latitude'] = $this->latitude; } if (isset($this->longitude)) { $json['longitude'] = $this->longitude; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 