*/ class GetSuggestedFollowsByActorResponse implements Arrayable { /** * @param Collection $suggestions */ public function __construct( public readonly Collection $suggestions, public readonly ?bool $isFallback = null, ) {} public static function fromArray(array $data): self { return new self( suggestions: collect($data['suggestions'] ?? [])->map( fn (array $profile) => ProfileView::fromArray($profile) ), isFallback: $data['isFallback'] ?? null, ); } public function toArray(): array { return [ 'suggestions' => $this->suggestions->map(fn (ProfileView $p) => $p->toArray())->all(), 'isFallback' => $this->isFallback, ]; } }