Laravel AT Protocol Client (alpha & unstable)
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add Arrayable interface to Ozone response classes

+69 -5
+13 -1
src/Data/Responses/Ozone/Moderation/QueryEventsResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Ozone\Moderation; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 use SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs\ModEventView; 7 8 8 - class QueryEventsResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class QueryEventsResponse implements Arrayable 9 13 { 10 14 /** 11 15 * @param Collection<int, ModEventView> $events ··· 23 27 ), 24 28 cursor: $data['cursor'] ?? null, 25 29 ); 30 + } 31 + 32 + public function toArray(): array 33 + { 34 + return [ 35 + 'events' => $this->events->map(fn (ModEventView $e) => $e->toArray())->all(), 36 + 'cursor' => $this->cursor, 37 + ]; 26 38 } 27 39 }
+13 -1
src/Data/Responses/Ozone/Moderation/QueryStatusesResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Ozone\Moderation; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 use SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs\SubjectStatusView; 7 8 8 - class QueryStatusesResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class QueryStatusesResponse implements Arrayable 9 13 { 10 14 /** 11 15 * @param Collection<int, SubjectStatusView> $subjectStatuses ··· 23 27 ), 24 28 cursor: $data['cursor'] ?? null, 25 29 ); 30 + } 31 + 32 + public function toArray(): array 33 + { 34 + return [ 35 + 'subjectStatuses' => $this->subjectStatuses->map(fn (SubjectStatusView $s) => $s->toArray())->all(), 36 + 'cursor' => $this->cursor, 37 + ]; 26 38 } 27 39 }
+13 -1
src/Data/Responses/Ozone/Moderation/SearchReposResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Ozone\Moderation; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 use SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs\RepoView; 7 8 8 - class SearchReposResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class SearchReposResponse implements Arrayable 9 13 { 10 14 /** 11 15 * @param Collection<int, RepoView> $repos ··· 23 27 ), 24 28 cursor: $data['cursor'] ?? null, 25 29 ); 30 + } 31 + 32 + public function toArray(): array 33 + { 34 + return [ 35 + 'repos' => $this->repos->map(fn (RepoView $r) => $r->toArray())->all(), 36 + 'cursor' => $this->cursor, 37 + ]; 26 38 } 27 39 }
+17 -1
src/Data/Responses/Ozone/Server/GetConfigResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Ozone\Server; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use SocialDept\AtpSchema\Generated\Tools\Ozone\Server\GetConfig\ServiceConfig; 6 7 use SocialDept\AtpSchema\Generated\Tools\Ozone\Server\GetConfig\ViewerConfig; 7 8 8 - class GetConfigResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class GetConfigResponse implements Arrayable 9 13 { 10 14 public function __construct( 11 15 public readonly ?ServiceConfig $appview = null, ··· 26 30 viewer: isset($data['viewer']) ? ViewerConfig::fromArray($data['viewer']) : null, 27 31 verifierDid: $data['verifierDid'] ?? null, 28 32 ); 33 + } 34 + 35 + public function toArray(): array 36 + { 37 + return [ 38 + 'appview' => $this->appview?->toArray(), 39 + 'pds' => $this->pds?->toArray(), 40 + 'blobDivert' => $this->blobDivert?->toArray(), 41 + 'chat' => $this->chat?->toArray(), 42 + 'viewer' => $this->viewer?->toArray(), 43 + 'verifierDid' => $this->verifierDid, 44 + ]; 29 45 } 30 46 }
+13 -1
src/Data/Responses/Ozone/Team/ListMembersResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Ozone\Team; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 7 - class ListMembersResponse 8 + /** 9 + * @implements Arrayable<string, mixed> 10 + */ 11 + class ListMembersResponse implements Arrayable 8 12 { 9 13 /** 10 14 * @param Collection<int, array<string, mixed>> $members Collection of team member objects ··· 20 24 members: collect($data['members'] ?? []), 21 25 cursor: $data['cursor'] ?? null, 22 26 ); 27 + } 28 + 29 + public function toArray(): array 30 + { 31 + return [ 32 + 'members' => $this->members->all(), 33 + 'cursor' => $this->cursor, 34 + ]; 23 35 } 24 36 }