Test Failed
Pull Request — master (#816)
by butschster
06:13 queued 32s
created

TelemetryInterceptor::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 0
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Queue\Interceptor\Push;
6
7
use Spiral\Core\CoreInterceptorInterface;
8
use Spiral\Core\CoreInterface;
9
use Spiral\Telemetry\NullTracer;
10
use Spiral\Telemetry\TracerInterface;
11
12
class TelemetryInterceptor implements CoreInterceptorInterface
13
{
14
    public function __construct(
15
        private readonly ?TracerInterface $tracer = new NullTracer(),
16
    ) {
17
    }
18
19
    public function process(string $controller, string $action, array $parameters, CoreInterface $core): mixed
20
    {
21
        $parameters['telemetry'] = $this->tracer->getContext();
0 ignored issues
show
Bug introduced by
The method getContext() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
        /** @scrutinizer ignore-call */ 
22
        $parameters['telemetry'] = $this->tracer->getContext();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
22
23
        return $core->callAction($controller, $action, $parameters);
24
    }
25
}
26