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

TracerFactory::fromContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Telemetry;
6
7
use Spiral\Core\Container;
8
use Spiral\Core\FactoryInterface;
9
10
final class TracerFactory implements TracerFactoryInterface
11
{
12
    public function __construct(
13
        private readonly ?FactoryInterface $factory = new Container()
14
    ) {
15
    }
16
17
    public function fromContext(?array $context): TracerInterface
18
    {
19
        return $this->factory->make(TracerInterface::class)
0 ignored issues
show
Bug introduced by
The method make() 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

19
        return $this->factory->/** @scrutinizer ignore-call */ make(TracerInterface::class)

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...
20
            ->withContext($context);
21
    }
22
}
23