Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Naoray committed Jan 16, 2025
1 parent 137fd3d commit b8c7612
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 59 deletions.
42 changes: 0 additions & 42 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -270,48 +270,6 @@ parameters:
count: 1
path: examples/subscriptions/update-subscription.php

-
message: '#^Parameter \#1 \$handle of class Mollie\\Api\\Http\\Adapter\\CurlFactory constructor expects resource, CurlHandle given\.$#'
identifier: argument.type
count: 1
path: src/Http/Adapter/CurlFactory.php

-
message: '#^Parameter \#1 \$handle of function curl_setopt expects CurlHandle, resource given\.$#'
identifier: argument.type
count: 1
path: src/Http/Adapter/CurlFactory.php

-
message: '#^Parameter \#1 \$handle of function curl_close expects CurlHandle, resource given\.$#'
identifier: argument.type
count: 1
path: src/Http/Adapter/CurlMollieHttpAdapter.php

-
message: '#^Parameter \#1 \$handle of function curl_errno expects CurlHandle, resource given\.$#'
identifier: argument.type
count: 1
path: src/Http/Adapter/CurlMollieHttpAdapter.php

-
message: '#^Parameter \#1 \$handle of function curl_error expects CurlHandle, resource given\.$#'
identifier: argument.type
count: 1
path: src/Http/Adapter/CurlMollieHttpAdapter.php

-
message: '#^Parameter \#1 \$handle of function curl_exec expects CurlHandle, resource given\.$#'
identifier: argument.type
count: 1
path: src/Http/Adapter/CurlMollieHttpAdapter.php

-
message: '#^Parameter \#1 \$handle of function curl_getinfo expects CurlHandle, resource given\.$#'
identifier: argument.type
count: 2
path: src/Http/Adapter/CurlMollieHttpAdapter.php

-
message: '#^Unsafe usage of new static\(\)\.$#'
identifier: new.static
Expand Down
12 changes: 0 additions & 12 deletions src/Http/Adapter/CurlFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,14 @@
use Mollie\Api\Http\PendingRequest;
use Mollie\Api\Types\Method;

/**
* @phpstan-type CurlType resource
*/
class CurlFactory
{
public const DEFAULT_TIMEOUT = 10;
public const DEFAULT_CONNECT_TIMEOUT = 2;

/**
* @var CurlType The curl handle
*/
private $handle;
private PendingRequest $pendingRequest;

/**
* @param CurlType $handle
*/
private function __construct($handle, PendingRequest $pendingRequest)
{
$this->handle = $handle;
Expand Down Expand Up @@ -93,9 +84,6 @@ public function withMethod(string $method, ?string $body): self
return $this;
}

/**
* @return CurlType
*/
public function create()
{
return $this->handle;
Expand Down
5 changes: 0 additions & 5 deletions src/Http/Adapter/CurlMollieHttpAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
use Mollie\Api\Traits\HasDefaultFactories;
use Throwable;

/**
* @phpstan-import-type CurlType from CurlFactory
*/
final class CurlMollieHttpAdapter implements HttpAdapterContract
{
use HasDefaultFactories;
Expand Down Expand Up @@ -57,7 +54,6 @@ public function sendRequest(PendingRequest $pendingRequest): Response
*/
protected function send(PendingRequest $pendingRequest): array
{
/** @var CurlType|null */
$curl = null;
$request = $pendingRequest->createPsrRequest();

Expand Down Expand Up @@ -105,7 +101,6 @@ protected function createResponse(PendingRequest $pendingRequest, int $statusCod
}

/**
* @param CurlType $curl
* @param string $response
* @return array{0: array<string, string>, 1: string, 2: int}
*/
Expand Down

0 comments on commit b8c7612

Please sign in to comment.