<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class ShiftWage implements \JsonSerializable { private $title; private $hourlyRate; public function getTitle(): ?string { return $this->title; } public function setTitle(?string $title): void { $this->title = $title; } public function getHourlyRate(): ?Money { return $this->hourlyRate; } public function setHourlyRate(?Money $hourlyRate): void { $this->hourlyRate = $hourlyRate; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->title)) { $json['title'] = $this->title; } if (isset($this->hourlyRate)) { $json['hourly_rate'] = $this->hourlyRate; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 