Skip to content

Commit

Permalink
fix!: make it breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
brokeyourbike committed Dec 25, 2021
1 parent dcc4531 commit ed86542
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,20 @@ public function verifyOneTimePassword(OtpRequestInterface $otpRequest, string $p
*/
private function performRequest(HttpMethodEnum $method, string $uri, array $data): ResponseInterface
{
$options = [
\GuzzleHttp\RequestOptions::HTTP_ERRORS => false,
\GuzzleHttp\RequestOptions::HEADERS => [
'Accept' => 'application/json',
],
];

$data['api_key'] = $this->config->getPublicKey();

$option = match($method) {
HttpMethodEnum::GET => \GuzzleHttp\RequestOptions::QUERY,
default => \GuzzleHttp\RequestOptions::JSON,
};

$options[$option] = $data;
$options = [
\GuzzleHttp\RequestOptions::HTTP_ERRORS => false,
\GuzzleHttp\RequestOptions::HEADERS => [
'Accept' => 'application/json',
],
$option => $data,
];

if ($this->getSourceModel()) {
$options[RequestOptions::SOURCE_MODEL] = $this->getSourceModel();
Expand Down

0 comments on commit ed86542

Please sign in to comment.