Issues (22)

src/Utils/SpansExporter.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * Spans exporter
4
 * User: moyo
5
 * Date: 16/01/2018
6
 * Time: 11:39 AM
7
 */
8
9
namespace Carno\Tracing\Utils;
10
11
use Carno\Coroutine\Context;
12
use Carno\Tracing\Contracts\Vars\CTX;
13
use Carno\Tracing\Contracts\Vars\FMT;
14
use Carno\Tracing\Standard\Span;
15
use Carno\Tracing\Standard\Tracer;
16
use Psr\Http\Message\MessageInterface;
0 ignored issues
show
The type Psr\Http\Message\MessageInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
18
trait SpansExporter
19
{
20
    /**
21
     * @param Context $ctx
22
     * @param MessageInterface $http
23
     */
24
    protected function spanToHResponse(Context $ctx, MessageInterface $http) : void
25
    {
26
        if ($ctx->has(CTX::G_TRACER) && $ctx->has(CTX::G_SPAN)) {
27
            /**
28
             * @var Tracer $tracer
29
             * @var Span $span
30
             */
31
            $tracer = $ctx->get(CTX::G_TRACER);
32
            $span = $ctx->get(CTX::G_SPAN);
33
34
            $tracer->inject($span->getContext(), FMT::HTTP_HEADERS, $http);
35
        }
36
    }
37
}
38