芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/bit-alphas-ltd.com/user/project/vendor/vonage/client-core/src/Account/Balance.php
data keys */ class Balance implements JsonSerializable, JsonSerializableInterface, JsonUnserializableInterface, ArrayAccess, ArrayHydrateInterface { /** * @var array */ protected $data; /** * @todo Have these take null values, since we offer an unserialize option to populate */ public function __construct($balance, $autoReload) { $this->data['balance'] = $balance; $this->data['auto_reload'] = $autoReload; } public function getBalance() { return $this->data['balance']; } public function getAutoReload() { return $this->data['auto_reload']; } public function jsonUnserialize(array $json): void { trigger_error( get_class($this) . "::jsonUnserialize is deprecated, please fromArray() instead", E_USER_DEPRECATED ); $this->fromArray($json); } public function jsonSerialize(): array { return $this->data; } public function offsetExists($offset): bool { trigger_error( "Array access for " . get_class($this) . " is deprecated, please use getter methods", E_USER_DEPRECATED ); return isset($this->data[$offset]); } #[\ReturnTypeWillChange] public function offsetGet($offset) { trigger_error( "Array access for " . get_class($this) . " is deprecated, please use getter methods", E_USER_DEPRECATED ); return $this->data[$offset]; } /** * @throws ClientException */ public function offsetSet($offset, $value): void { throw new ClientException('Balance is read only'); } /** * @throws ClientException */ public function offsetUnset($offset): void { throw new ClientException('Balance is read only'); } public function fromArray(array $data): void { $this->data = [ 'balance' => $data['value'], 'auto_reload' => $data['autoReload'] ]; } public function toArray(): array { return $this->data; } /** * @noinspection MagicMethodsValidityInspection */ public function __get($key): ?array { if ($key === 'data') { trigger_error( "Direct access to " . get_class($this) . "::data is deprecated, please use getter to toArray() methods", E_USER_DEPRECATED ); return $this->data; } return null; } }