forked from apoloz/alfa-bank-sdk
fix(formating)
This commit is contained in:
@@ -17,6 +17,7 @@ use Saloon\Enums\Method;
|
||||
use Saloon\Http\Request;
|
||||
use Saloon\Http\Response;
|
||||
use Spatie\LaravelData\DataCollection;
|
||||
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="class_definition" intent="Define the request to get all steps for a deal.">
|
||||
@@ -45,6 +46,14 @@ class GetStepsRequest extends Request
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="response_caster" intent="Map the JSON array response to a collection of DTOs.">
|
||||
// <BELIEF_STATE "The API returns a JSON array. Using `StepData::collect` automatically converts this array into a type-safe, iterable `DataCollection` of `StepData` objects.">
|
||||
public function createDtoFromResponse(Response $response): DataCollection
|
||||
{
|
||||
return StepData::collect($response->json(), DataCollection::class);
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="query_builder" intent="Construct the query string for pagination.">
|
||||
// <BELIEF_STATE "The `defaultQuery` method properly assigns the pagination parameters to the query string.">
|
||||
protected function defaultQuery(): array
|
||||
@@ -55,12 +64,4 @@ class GetStepsRequest extends Request
|
||||
];
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="response_caster" intent="Map the JSON array response to a collection of DTOs.">
|
||||
// <BELIEF_STATE "The API returns a JSON array. Using `StepData::collect` automatically converts this array into a type-safe, iterable `DataCollection` of `StepData` objects.">
|
||||
public function createDtoFromResponse(Response $response): DataCollection
|
||||
{
|
||||
return StepData::collect($response->json(), DataCollection::class);
|
||||
}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user