<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class Range implements \JsonSerializable { private $min; private $max; public function getMin(): ?string { return $this->min; } public function setMin(?string $min): void { $this->min = $min; } public function getMax(): ?string { return $this->max; } public function setMax(?string $max): void { $this->max = $max; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->min)) { $json['min'] = $this->min; } if (isset($this->max)) { $json['max'] = $this->max; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 