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 Actor response classes

+50 -4
+12 -1
src/Data/Responses/Bsky/Actor/GetProfilesResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Bsky\Actor; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewDetailed; 7 8 8 - class GetProfilesResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class GetProfilesResponse implements Arrayable 9 13 { 10 14 /** 11 15 * @param Collection<int, ProfileViewDetailed> $profiles ··· 21 25 fn (array $profile) => ProfileViewDetailed::fromArray($profile) 22 26 ), 23 27 ); 28 + } 29 + 30 + public function toArray(): array 31 + { 32 + return [ 33 + 'profiles' => $this->profiles->map(fn (ProfileViewDetailed $p) => $p->toArray())->all(), 34 + ]; 24 35 } 25 36 }
+13 -1
src/Data/Responses/Bsky/Actor/GetSuggestionsResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Bsky\Actor; 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 GetSuggestionsResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class GetSuggestionsResponse implements Arrayable 9 13 { 10 14 /** 11 15 * @param Collection<int, ProfileView> $actors ··· 23 27 ), 24 28 cursor: $data['cursor'] ?? null, 25 29 ); 30 + } 31 + 32 + public function toArray(): array 33 + { 34 + return [ 35 + 'actors' => $this->actors->map(fn (ProfileView $a) => $a->toArray())->all(), 36 + 'cursor' => $this->cursor, 37 + ]; 26 38 } 27 39 }
+13 -1
src/Data/Responses/Bsky/Actor/SearchActorsResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Bsky\Actor; 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 SearchActorsResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class SearchActorsResponse implements Arrayable 9 13 { 10 14 /** 11 15 * @param Collection<int, ProfileView> $actors ··· 23 27 ), 24 28 cursor: $data['cursor'] ?? null, 25 29 ); 30 + } 31 + 32 + public function toArray(): array 33 + { 34 + return [ 35 + 'actors' => $this->actors->map(fn (ProfileView $a) => $a->toArray())->all(), 36 + 'cursor' => $this->cursor, 37 + ]; 26 38 } 27 39 }
+12 -1
src/Data/Responses/Bsky/Actor/SearchActorsTypeaheadResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Bsky\Actor; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewBasic; 7 8 8 - class SearchActorsTypeaheadResponse 9 + /** 10 + * @implements Arrayable<string, mixed> 11 + */ 12 + class SearchActorsTypeaheadResponse implements Arrayable 9 13 { 10 14 /** 11 15 * @param Collection<int, ProfileViewBasic> $actors ··· 21 25 fn (array $actor) => ProfileViewBasic::fromArray($actor) 22 26 ), 23 27 ); 28 + } 29 + 30 + public function toArray(): array 31 + { 32 + return [ 33 + 'actors' => $this->actors->map(fn (ProfileViewBasic $a) => $a->toArray())->all(), 34 + ]; 24 35 } 25 36 }