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 Bsky Graph response classes

+107 -8
+14 -1
src/Data/Responses/Bsky/Graph/GetFollowersResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView; 7 8 8 - class GetFollowersResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class GetFollowersResponse implements Arrayable 9 13 { 10 14 /** 11 15 * @param Collection<int, ProfileView> $followers ··· 25 29 ), 26 30 cursor: $data['cursor'] ?? null, 27 31 ); 32 + } 33 + 34 + public function toArray(): array 35 + { 36 + return [ 37 + 'subject' => $this->subject->toArray(), 38 + 'followers' => $this->followers->map(fn (ProfileView $p) => $p->toArray())->all(), 39 + 'cursor' => $this->cursor, 40 + ]; 28 41 } 29 42 }
+14 -1
src/Data/Responses/Bsky/Graph/GetFollowsResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView; 7 8 8 - class GetFollowsResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class GetFollowsResponse implements Arrayable 9 13 { 10 14 /** 11 15 * @param Collection<int, ProfileView> $follows ··· 25 29 ), 26 30 cursor: $data['cursor'] ?? null, 27 31 ); 32 + } 33 + 34 + public function toArray(): array 35 + { 36 + return [ 37 + 'subject' => $this->subject->toArray(), 38 + 'follows' => $this->follows->map(fn (ProfileView $p) => $p->toArray())->all(), 39 + 'cursor' => $this->cursor, 40 + ]; 28 41 } 29 42 }
+14 -1
src/Data/Responses/Bsky/Graph/GetKnownFollowersResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView; 7 8 8 - class GetKnownFollowersResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class GetKnownFollowersResponse implements Arrayable 9 13 { 10 14 /** 11 15 * @param Collection<int, ProfileView> $followers ··· 25 29 ), 26 30 cursor: $data['cursor'] ?? null, 27 31 ); 32 + } 33 + 34 + public function toArray(): array 35 + { 36 + return [ 37 + 'subject' => $this->subject->toArray(), 38 + 'followers' => $this->followers->map(fn (ProfileView $p) => $p->toArray())->all(), 39 + 'cursor' => $this->cursor, 40 + ]; 28 41 } 29 42 }
+14 -1
src/Data/Responses/Bsky/Graph/GetListResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\ListItemView; 7 8 use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\ListView; 8 9 9 - class GetListResponse 10 + /** 11 + * @implements Arrayable<string, mixed> 12 + */ 13 + class GetListResponse implements Arrayable 10 14 { 11 15 /** 12 16 * @param Collection<int, ListItemView> $items ··· 26 30 ), 27 31 cursor: $data['cursor'] ?? null, 28 32 ); 33 + } 34 + 35 + public function toArray(): array 36 + { 37 + return [ 38 + 'list' => $this->list->toArray(), 39 + 'items' => $this->items->map(fn (ListItemView $i) => $i->toArray())->all(), 40 + 'cursor' => $this->cursor, 41 + ]; 29 42 } 30 43 }
+13 -1
src/Data/Responses/Bsky/Graph/GetListsResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\ListView; 7 8 8 - class GetListsResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class GetListsResponse implements Arrayable 9 13 { 10 14 /** 11 15 * @param Collection<int, ListView> $lists ··· 23 27 ), 24 28 cursor: $data['cursor'] ?? null, 25 29 ); 30 + } 31 + 32 + public function toArray(): array 33 + { 34 + return [ 35 + 'lists' => $this->lists->map(fn (ListView $l) => $l->toArray())->all(), 36 + 'cursor' => $this->cursor, 37 + ]; 26 38 } 27 39 }
+13 -1
src/Data/Responses/Bsky/Graph/GetRelationshipsResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 7 - class GetRelationshipsResponse 8 + /** 9 + * @implements Arrayable<string, mixed> 10 + */ 11 + class GetRelationshipsResponse implements Arrayable 8 12 { 9 13 /** 10 14 * @param Collection<int, mixed> $relationships Collection of Relationship or NotFoundActor objects ··· 20 24 relationships: collect($data['relationships'] ?? []), 21 25 actor: $data['actor'] ?? null, 22 26 ); 27 + } 28 + 29 + public function toArray(): array 30 + { 31 + return [ 32 + 'relationships' => $this->relationships->all(), 33 + 'actor' => $this->actor, 34 + ]; 23 35 } 24 36 }
+12 -1
src/Data/Responses/Bsky/Graph/GetStarterPacksResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\StarterPackViewBasic; 7 8 8 - class GetStarterPacksResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class GetStarterPacksResponse implements Arrayable 9 13 { 10 14 /** 11 15 * @param Collection<int, StarterPackViewBasic> $starterPacks ··· 21 25 fn (array $pack) => StarterPackViewBasic::fromArray($pack) 22 26 ), 23 27 ); 28 + } 29 + 30 + public function toArray(): array 31 + { 32 + return [ 33 + 'starterPacks' => $this->starterPacks->map(fn (StarterPackViewBasic $p) => $p->toArray())->all(), 34 + ]; 24 35 } 25 36 }
+13 -1
src/Data/Responses/Bsky/Graph/GetSuggestedFollowsByActorResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView; 7 8 8 - class GetSuggestedFollowsByActorResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class GetSuggestedFollowsByActorResponse implements Arrayable 9 13 { 10 14 /** 11 15 * @param Collection<int, ProfileView> $suggestions ··· 23 27 ), 24 28 isFallback: $data['isFallback'] ?? null, 25 29 ); 30 + } 31 + 32 + public function toArray(): array 33 + { 34 + return [ 35 + 'suggestions' => $this->suggestions->map(fn (ProfileView $p) => $p->toArray())->all(), 36 + 'isFallback' => $this->isFallback, 37 + ]; 26 38 } 27 39 }