<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class V1PhoneNumber implements \JsonSerializable { private $callingCode; private $number; public function __construct(string $callingCode, string $number) { $this->callingCode = $callingCode; $this->number = $number; } public function getCallingCode(): string { return $this->callingCode; } public function setCallingCode(string $callingCode): void { $this->callingCode = $callingCode; } public function getNumber(): string { return $this->number; } public function setNumber(string $number): void { $this->number = $number; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['calling_code'] = $this->callingCode; $json['number'] = $this->number; $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 