Skip to content

Commit

Permalink
feat(Common): phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
neiluJ committed Dec 11, 2024
1 parent 2e4f6fa commit 9fa7189
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Http/HttpMessageHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public static function formatHeadersForSpanAttribute(array $headers): string
return implode(\PHP_EOL, $lines);
}

/**
* @param array<string,string|string[]> $headers
*/
public static function getContentType(array $headers): ?string
{
$headers = HttpSensitiveDataHelper::filterHeaders($headers);
Expand Down
8 changes: 7 additions & 1 deletion src/Http/TracingHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\HttpClient\HttpClientTrait;
use Symfony\Component\HttpClient\Response\ResponseStream;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
use Symfony\Contracts\HttpClient\ResponseStreamInterface;
Expand All @@ -37,7 +38,7 @@ class TracingHttpClient implements HttpClientInterface
/**
* @param HttpClientInterface|array<mixed>|null $client
*/
public function __construct(
final public function __construct(
HttpClientInterface|array $client = null,
ClientRequestOperationNameResolverInterface $operationNameResolver = null,
ClientRequestAttributeProviderInterface $attributeProvider = null,
Expand Down Expand Up @@ -84,8 +85,13 @@ protected function getExtraSpanAttributes(array|null $attributes): array
* operation_name: non-empty-string,
* span_attributes: array<non-empty-string>,
* extra_attributes: array<non-empty-string, string>
* },
* user_data?: array{
* on_request_body_callback?: callable|array<string|object, string>,
* on_response_body_callback?: callable|array<string|object, string>
* }
* } $options
* @throws TransportExceptionInterface
*/
public function request(string $method, string $url, array $options = []): ResponseInterface
{
Expand Down

0 comments on commit 9fa7189

Please sign in to comment.