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