Passed
Pull Request — master (#816)
by butschster
06:49
created

NullTracerFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A make() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Telemetry;
6
7
use Spiral\Core\Container;
8
use Spiral\Core\ScopeInterface;
9
10
final class NullTracerFactory implements TracerFactoryInterface
11
{
12 319
    public function __construct(
13
        private readonly ?ScopeInterface $scope = new Container(),
14
    ) {
15
    }
16
17 315
    public function make(array $context = []): TracerInterface
18
    {
19 315
        return new NullTracer($this->scope);
20
    }
21
}
22