<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class BusinessHoursPeriod implements \JsonSerializable { private $dayOfWeek; private $startLocalTime; private $endLocalTime; public function getDayOfWeek(): ?string { return $this->dayOfWeek; } public function setDayOfWeek(?string $dayOfWeek): void { $this->dayOfWeek = $dayOfWeek; } public function getStartLocalTime(): ?string { return $this->startLocalTime; } public function setStartLocalTime(?string $startLocalTime): void { $this->startLocalTime = $startLocalTime; } public function getEndLocalTime(): ?string { return $this->endLocalTime; } public function setEndLocalTime(?string $endLocalTime): void { $this->endLocalTime = $endLocalTime; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->dayOfWeek)) { $json['day_of_week'] = $this->dayOfWeek; } if (isset($this->startLocalTime)) { $json['start_local_time'] = $this->startLocalTime; } if (isset($this->endLocalTime)) { $json['end_local_time'] = $this->endLocalTime; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 