fix(formating)

This commit is contained in:
Anatoliy Poloz
2026-01-28 03:36:26 +03:00
parent 1723177949
commit b15d29f8e9
313 changed files with 1863 additions and 1533 deletions

View File

@@ -18,6 +18,7 @@ use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\Http\Response;
use Saloon\Traits\Body\HasJsonBody;
// </SECTION>
// <SECTION name="class_definition" intent="Define the request to get the SBP bank list.">
@@ -46,6 +47,14 @@ class GetBankListRequest extends Request implements HasBody
}
// </SECTION>
// <SECTION name="response_caster" intent="Map the JSON response to a DTO.">
// <BELIEF_STATE "Casting the response to a `GetBankListResponseData` DTO provides a type-safe and structured object for the list of SBP banks.">
public function createDtoFromResponse(Response $response): GetBankListResponseData
{
return GetBankListResponseData::from($response->json());
}
// </SECTION>
// <SECTION name="body_builder" intent="Construct the JSON body for the request.">
// <BELIEF_STATE "The `command` field specifies the operation to the SBP API. Optional fields are conditionally added to the body.">
protected function defaultBody(): array
@@ -54,18 +63,14 @@ class GetBankListRequest extends Request implements HasBody
'command' => 'GetBankList',
];
if ($this->messageID !== null) $body['messageID'] = $this->messageID;
if ($this->BankMemberIdFilter !== null) $body['BankMemberIdFilter'] = $this->BankMemberIdFilter;
if ($this->messageID !== null) {
$body['messageID'] = $this->messageID;
}
if ($this->BankMemberIdFilter !== null) {
$body['BankMemberIdFilter'] = $this->BankMemberIdFilter;
}
return $body;
}
// </SECTION>
// <SECTION name="response_caster" intent="Map the JSON response to a DTO.">
// <BELIEF_STATE "Casting the response to a `GetBankListResponseData` DTO provides a type-safe and structured object for the list of SBP banks.">
public function createDtoFromResponse(Response $response): GetBankListResponseData
{
return GetBankListResponseData::from($response->json());
}
// </SECTION>
}