<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class ShiftSort implements \JsonSerializable { private $field; private $order; public function getField(): ?string { return $this->field; } public function setField(?string $field): void { $this->field = $field; } public function getOrder(): ?string { return $this->order; } public function setOrder(?string $order): void { $this->order = $order; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->field)) { $json['field'] = $this->field; } if (isset($this->order)) { $json['order'] = $this->order; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 