<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class QuantityRatio implements \JsonSerializable { private $quantity; private $quantityDenominator; public function getQuantity(): ?int { return $this->quantity; } public function setQuantity(?int $quantity): void { $this->quantity = $quantity; } public function getQuantityDenominator(): ?int { return $this->quantityDenominator; } public function setQuantityDenominator(?int $quantityDenominator): void { $this->quantityDenominator = $quantityDenominator; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->quantity)) { $json['quantity'] = $this->quantity; } if (isset($this->quantityDenominator)) { $json['quantity_denominator'] = $this->quantityDenominator; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 