芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/bit-alphas-ltd.com/user/project/vendor/vonage/client-core/src/Message/Shortcode.php
to = $to; $this->custom = $custom; $this->options = $options; } public function setCustom(array $custom): void { $this->custom = $custom; } public function setOptions(array $options): void { $this->options = $options; } public function getType(): string { return $this->type; } public function getRequestData(): array { // Options, then custom, then to. This is the priority // we want so that people can't overwrite to with a custom param return $this->options + $this->custom + ['to' => $this->to]; } /** * @throws ClientException * * @return Alert|Marketing|TwoFactor|null */ public static function createMessageFromArray(array $data) { if (!isset($data['type'])) { throw new ClientException('No type provided when creating a shortcode message'); } if (!isset($data['to'])) { throw new ClientException('No to provided when creating a shortcode message'); } $data['type'] = strtolower($data['type']); if ($data['type'] === '2fa') { $m = new TwoFactor($data['to']); } elseif ($data['type'] === 'marketing') { $m = new Marketing($data['to']); } elseif ($data['type'] === 'alert') { $m = new Alert($data['to']); } if (isset($m)) { if (isset($data['custom'])) { $m->setCustom($data['custom']); } if (isset($data['options'])) { $m->setOptions($data['options']); } return $m; } return null; } }