Skip to content

Commit

Permalink
fix static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
alekitto committed Jul 11, 2022
1 parent 27d9d53 commit dcea7b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Expand Up @@ -280,11 +280,6 @@ parameters:
count: 1
path: src/Tracing/HttpClient/AbstractTraceableResponse.php

-
message: "#^Method Sentry\\\\SentryBundle\\\\Tracing\\\\HttpClient\\\\AbstractTraceableResponse::stream\\(\\) has parameter \\$responses with no value type specified in iterable type iterable.$#"
count: 1
path: src/Tracing/HttpClient/AbstractTraceableResponse.php

-
message: "#^Method Sentry\\\\SentryBundle\\\\Tracing\\\\HttpClient\\\\TraceableHttpClientForV6::withOptions\\(\\) has parameter \\$options with no value type specified in iterable type array.$#"
count: 1
Expand Down
2 changes: 2 additions & 0 deletions src/Tracing/HttpClient/AbstractTraceableHttpClient.php
Expand Up @@ -72,6 +72,8 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
{
if ($responses instanceof AbstractTraceableResponse) {
$responses = [$responses];
} elseif (!is_iterable($responses)) {
throw new \TypeError(sprintf('"%s()" expects parameter 1 to be an iterable of TraceableResponse objects, "%s" given.', __METHOD__, get_debug_type($responses)));
}

return new ResponseStream(AbstractTraceableResponse::stream($this->client, $responses, $timeout));
Expand Down
2 changes: 2 additions & 0 deletions tests/Tracing/HttpClient/TraceableHttpClientTest.php
Expand Up @@ -87,6 +87,7 @@ public function testRequest(): void

$response->getContent(false);

$this->assertNotNull($transaction->getSpanRecorder());
$spans = $transaction->getSpanRecorder()->getSpans();
$this->assertCount(2, $spans);
$this->assertNotNull($spans[1]->getEndTimestamp());
Expand Down Expand Up @@ -118,6 +119,7 @@ public function testStream(): void
$chunks[] = $chunk->getContent();
}

$this->assertNotNull($transaction->getSpanRecorder());
$spans = $transaction->getSpanRecorder()->getSpans();
$expectedTags = [
'http.method' => 'GET',
Expand Down

0 comments on commit dcea7b5

Please sign in to comment.