-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
namespace Mollie\Api\Http\Adapter; | ||
|
||
use CurlHandle; | ||
use Mollie\Api\Contracts\HttpAdapterContract; | ||
use Mollie\Api\Exceptions\NetworkRequestException; | ||
use Mollie\Api\Exceptions\RetryableNetworkRequestException; | ||
|
@@ -12,6 +11,9 @@ | |
use Mollie\Api\Traits\HasDefaultFactories; | ||
use Throwable; | ||
|
||
/** | ||
* @phpstan-import-type CurlType from CurlFactory | ||
*/ | ||
final class CurlMollieHttpAdapter implements HttpAdapterContract | ||
{ | ||
use HasDefaultFactories; | ||
|
@@ -51,9 +53,11 @@ public function sendRequest(PendingRequest $pendingRequest): Response | |
|
||
/** | ||
* @throws NetworkRequestException | ||
* @return array{0: array<string, string>, 1: string, 2: int} | ||
*/ | ||
protected function send(PendingRequest $pendingRequest): array | ||
{ | ||
/** @var CurlType|null */ | ||
$curl = null; | ||
Check failure on line 61 in src/Http/Adapter/CurlMollieHttpAdapter.php GitHub Actions / PHP - 7.4
Check failure on line 61 in src/Http/Adapter/CurlMollieHttpAdapter.php GitHub Actions / PHP - 7.4
|
||
$request = $pendingRequest->createPsrRequest(); | ||
|
||
|
@@ -100,7 +104,12 @@ protected function createResponse(PendingRequest $pendingRequest, int $statusCod | |
); | ||
} | ||
|
||
private function extractResponseDetails(CurlHandle $curl, string $response): array | ||
/** | ||
* @param CurlType $curl | ||
* @param string $response | ||
* @return array{0: array<string, string>, 1: string, 2: int} | ||
*/ | ||
private function extractResponseDetails($curl, string $response): array | ||
Check failure on line 112 in src/Http/Adapter/CurlMollieHttpAdapter.php GitHub Actions / PHP - 7.4
|
||
{ | ||
$headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE); | ||
$headerValues = substr($response, 0, $headerSize); | ||
|