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