<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CatalogQuerySet implements \JsonSerializable { private $attributeName; private $attributeValues; public function __construct(string $attributeName, array $attributeValues) { $this->attributeName = $attributeName; $this->attributeValues = $attributeValues; } public function getAttributeName(): string { return $this->attributeName; } public function setAttributeName(string $attributeName): void { $this->attributeName = $attributeName; } public function getAttributeValues(): array { return $this->attributeValues; } public function setAttributeValues(array $attributeValues): void { $this->attributeValues = $attributeValues; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['attribute_name'] = $this->attributeName; $json['attribute_values'] = $this->attributeValues; $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 