Skip to content

Commit

Permalink
chore: removes return type from unwrap method in HTTP Request/Respons…
Browse files Browse the repository at this point in the history
…e. (#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.
  • Loading branch information
jcchavezs authored Nov 4, 2021
1 parent ba8bc09 commit df7be29
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions src/Zipkin/Instrumentation/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
4 changes: 2 additions & 2 deletions src/Zipkin/Instrumentation/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit df7be29

Please sign in to comment.