Skip to content

Commit b3866a9

Browse files
committed
chore: moves RequestHeaders into propagation folder, also adds typing to the default parsers.
1 parent d15581c commit b3866a9

File tree

6 files changed

+22
-2
lines changed

6 files changed

+22
-2
lines changed

src/Zipkin/Instrumentation/Http/Client/Psr18/Client.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Zipkin\SpanCustomizerShield;
99
use Zipkin\Propagation\TraceContext;
1010
use Zipkin\Kind;
11+
use Zipkin\Instrumentation\Http\Client\Psr18\Propagation\RequestHeaders;
1112
use Zipkin\Instrumentation\Http\Client\Parser;
1213
use Zipkin\Instrumentation\Http\Client\HttpClientTracing;
1314
use Throwable;

src/Zipkin/Instrumentation/Http/Client/Psr18/DefaultParser.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,28 @@
1818
*/
1919
class DefaultParser implements Parser
2020
{
21+
/**
22+
* @param RequestInterface $request
23+
*/
2124
public function spanName($request): string
2225
{
2326
self::assertRequestType($request);
2427
return $request->getMethod();
2528
}
2629

30+
/**
31+
* @param RequestInterface $request
32+
*/
2733
public function request($request, TraceContext $context, SpanCustomizer $span): void
2834
{
2935
self::assertRequestType($request);
3036
$span->tag(Tags\HTTP_METHOD, $request->getMethod());
3137
$span->tag(Tags\HTTP_PATH, $request->getUri()->getPath() ?: "/");
3238
}
3339

40+
/**
41+
* @param ResponseInterface $response
42+
*/
3443
public function response($response, TraceContext $context, SpanCustomizer $span): void
3544
{
3645
self::assertResponseType($response);

src/Zipkin/Instrumentation/Http/Client/Psr18/RequestHeaders.php renamed to src/Zipkin/Instrumentation/Http/Client/Psr18/Propagation/RequestHeaders.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Zipkin\Instrumentation\Http\Client\Psr18;
5+
namespace Zipkin\Instrumentation\Http\Client\Psr18\Propagation;
66

77
use Zipkin\Propagation\RequestHeaders as BaseRequestHeaders;
88
use Zipkin\Propagation\RemoteSetter;

src/Zipkin/Instrumentation/Http/Server/Psr15/DefaultParser.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,28 @@
1818
*/
1919
class DefaultParser implements Parser
2020
{
21+
/**
22+
* @param ServerRequestInterface $request
23+
*/
2124
public function spanName($request): string
2225
{
2326
self::assertRequestType($request);
2427
return $request->getMethod();
2528
}
2629

30+
/**
31+
* @param ServerRequestInterface $request
32+
*/
2733
public function request($request, TraceContext $context, SpanCustomizer $span): void
2834
{
2935
self::assertRequestType($request);
3036
$span->tag(Tags\HTTP_METHOD, $request->getMethod());
3137
$span->tag(Tags\HTTP_PATH, $request->getUri()->getPath() ?: "/");
3238
}
3339

40+
/**
41+
* @param ResponseInterface $response
42+
*/
3443
public function response($response, TraceContext $context, SpanCustomizer $span): void
3544
{
3645
self::assertResponseType($response);

src/Zipkin/Instrumentation/Http/Server/Psr15/Middleware.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Zipkin\Propagation\SamplingFlags;
1212
use Zipkin\Propagation\DefaultSamplingFlags;
1313
use Zipkin\Kind;
14+
use Zipkin\Instrumentation\Http\Server\Psr15\Propagation\RequestHeaders;
1415
use Zipkin\Instrumentation\Http\Server\Parser;
1516
use Zipkin\Instrumentation\Http\Server\HttpServerTracing;
1617
use Throwable;

src/Zipkin/Instrumentation/Http/Server/Psr15/RequestHeaders.php renamed to src/Zipkin/Instrumentation/Http/Server/Psr15/Propagation/RequestHeaders.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Zipkin\Instrumentation\Http\Server\Psr15;
5+
namespace Zipkin\Instrumentation\Http\Server\Psr15\Propagation;
66

77
use Zipkin\Propagation\RequestHeaders as BaseRequestHeaders;
88
use Zipkin\Propagation\RemoteSetter;

0 commit comments

Comments
 (0)