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