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