Laravel AT Protocol Client (alpha & unstable)
at v0.0.55 610 B view raw
1<?php 2 3namespace SocialDept\AtpClient\Data; 4 5use Illuminate\Contracts\Support\Arrayable; 6 7/** 8 * @implements Arrayable<string, string> 9 */ 10class StrongRef implements Arrayable 11{ 12 public function __construct( 13 public readonly string $uri, 14 public readonly string $cid, 15 ) {} 16 17 public static function fromResponse(array $data): self 18 { 19 return new self( 20 uri: $data['uri'], 21 cid: $data['cid'], 22 ); 23 } 24 25 public function toArray(): array 26 { 27 return [ 28 'uri' => $this->uri, 29 'cid' => $this->cid, 30 ]; 31 } 32}