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