芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/bit-alphas-ltd.com/user/project/vendor/vonage/client-core/src/Voice/Endpoint/SIP.php
*/ protected $headers = []; /** * @var string */ protected $id; public function __construct(string $uri, array $headers = []) { $this->id = $uri; $this->setHeaders($headers); } public static function factory(string $uri, array $headers = []): SIP { return new SIP($uri, $headers); } /** * @return array{type: string, uri: string, headers?: array
} */ public function jsonSerialize(): array { return $this->toArray(); } /** * @return array{type: string, uri: string, headers?: array
} */ public function toArray(): array { $data = [ 'type' => 'sip', 'uri' => $this->id, ]; if (!empty($this->getHeaders())) { $data['headers'] = $this->getHeaders(); } return $data; } public function getId(): string { return $this->id; } public function getHeaders(): array { return $this->headers; } /** * @return $this */ public function addHeader(string $key, string $value): self { $this->headers[$key] = $value; return $this; } /** * @return $this */ public function setHeaders(array $headers): self { $this->headers = $headers; return $this; } }