From df7be298fc8bf93d0b87d019496b5c73733cd121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Ch=C3=A1vez?= Date: Thu, 4 Nov 2021 11:26:26 +0100 Subject: [PATCH] chore: removes return type from unwrap method in HTTP Request/Response. (#220) This is needed because we can't do any guarantee about the types of underlying request/response models, e.g. in PSR we would use an object but in Symfony Client it is most likely be an array, hence removing the optional object constraint. --- composer.json | 7 ++++++- src/Zipkin/Instrumentation/Http/Request.php | 4 ++-- src/Zipkin/Instrumentation/Http/Response.php | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index e218cbda..805a8ed4 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,12 @@ "scripts": { "fix-lint": "phpcbf --standard=ZEND --standard=PSR2 --ignore=*/vendor/* ./", "lint": "phpcs --standard=ZEND --standard=PSR2 --ignore=*/vendor/* ./", - "test": "phpunit tests", + "test": [ + "@test-unit", + "@test-integration" + ], + "test-unit": "phpunit tests/Unit", + "test-integration": "phpunit tests/Integration", "static-check": "phpstan analyse src --level 8" }, "suggest": { diff --git a/src/Zipkin/Instrumentation/Http/Request.php b/src/Zipkin/Instrumentation/Http/Request.php index 193ea10e..8dc665c1 100644 --- a/src/Zipkin/Instrumentation/Http/Request.php +++ b/src/Zipkin/Instrumentation/Http/Request.php @@ -60,7 +60,7 @@ abstract public function getUrl(): string; abstract public function getHeader(string $name): ?string; /** - * @return object|null the underlying request object or {@code null} if there is none. + * @return mixed the underlying request object or {@code null} if there is none. */ - abstract public function unwrap(): ?object; + abstract public function unwrap(); } diff --git a/src/Zipkin/Instrumentation/Http/Response.php b/src/Zipkin/Instrumentation/Http/Response.php index 90fcd6a5..e1034fd7 100644 --- a/src/Zipkin/Instrumentation/Http/Response.php +++ b/src/Zipkin/Instrumentation/Http/Response.php @@ -27,7 +27,7 @@ abstract public function getRequest(); abstract public function getStatusCode(): int; /** - * @return object|null the underlying response object or {@code null} if there is none. + * @return mixed the underlying response object or {@code null} if there is none. */ - abstract public function unwrap(): ?object; + abstract public function unwrap(); }