Skip to content

Commit df7be29

Browse files
authored
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.
1 parent ba8bc09 commit df7be29

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@
6666
"scripts": {
6767
"fix-lint": "phpcbf --standard=ZEND --standard=PSR2 --ignore=*/vendor/* ./",
6868
"lint": "phpcs --standard=ZEND --standard=PSR2 --ignore=*/vendor/* ./",
69-
"test": "phpunit tests",
69+
"test": [
70+
"@test-unit",
71+
"@test-integration"
72+
],
73+
"test-unit": "phpunit tests/Unit",
74+
"test-integration": "phpunit tests/Integration",
7075
"static-check": "phpstan analyse src --level 8"
7176
},
7277
"suggest": {

src/Zipkin/Instrumentation/Http/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ abstract public function getUrl(): string;
6060
abstract public function getHeader(string $name): ?string;
6161

6262
/**
63-
* @return object|null the underlying request object or {@code null} if there is none.
63+
* @return mixed the underlying request object or {@code null} if there is none.
6464
*/
65-
abstract public function unwrap(): ?object;
65+
abstract public function unwrap();
6666
}

src/Zipkin/Instrumentation/Http/Response.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ abstract public function getRequest();
2727
abstract public function getStatusCode(): int;
2828

2929
/**
30-
* @return object|null the underlying response object or {@code null} if there is none.
30+
* @return mixed the underlying response object or {@code null} if there is none.
3131
*/
32-
abstract public function unwrap(): ?object;
32+
abstract public function unwrap();
3333
}

0 commit comments

Comments
 (0)