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

TelemetryInterceptor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 12
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A process() 0 5 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