diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index dc7a6fbc..754d4f04 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -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 diff --git a/src/Http/Adapter/CurlFactory.php b/src/Http/Adapter/CurlFactory.php index 85a3f8b8..069082dd 100644 --- a/src/Http/Adapter/CurlFactory.php +++ b/src/Http/Adapter/CurlFactory.php @@ -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; @@ -93,9 +84,6 @@ public function withMethod(string $method, ?string $body): self return $this; } - /** - * @return CurlType - */ public function create() { return $this->handle; diff --git a/src/Http/Adapter/CurlMollieHttpAdapter.php b/src/Http/Adapter/CurlMollieHttpAdapter.php index c24cdabd..9be28e13 100644 --- a/src/Http/Adapter/CurlMollieHttpAdapter.php +++ b/src/Http/Adapter/CurlMollieHttpAdapter.php @@ -11,9 +11,6 @@ use Mollie\Api\Traits\HasDefaultFactories; use Throwable; -/** - * @phpstan-import-type CurlType from CurlFactory - */ final class CurlMollieHttpAdapter implements HttpAdapterContract { use HasDefaultFactories; @@ -57,7 +54,6 @@ public function sendRequest(PendingRequest $pendingRequest): Response */ protected function send(PendingRequest $pendingRequest): array { - /** @var CurlType|null */ $curl = null; $request = $pendingRequest->createPsrRequest(); @@ -105,7 +101,6 @@ protected function createResponse(PendingRequest $pendingRequest, int $statusCod } /** - * @param CurlType $curl * @param string $response * @return array{0: array, 1: string, 2: int} */