<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class MeasurementUnitCustom implements \JsonSerializable { private $name; private $abbreviation; public function __construct(string $name, string $abbreviation) { $this->name = $name; $this->abbreviation = $abbreviation; } public function getName(): string { return $this->name; } public function setName(string $name): void { $this->name = $name; } public function getAbbreviation(): string { return $this->abbreviation; } public function setAbbreviation(string $abbreviation): void { $this->abbreviation = $abbreviation; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['name'] = $this->name; $json['abbreviation'] = $this->abbreviation; $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 