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