Passed
Pull Request — master (#816)
by butschster
06:28
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
/**
11
 * @internal The component is under development.
12
 * Something may be changed in the future. We will stable it soon.
13
 * Feedback is welcome {@link https://github.com/spiral/framework/discussions/822}.
14
 */
15
final class NullTracerFactory implements TracerFactoryInterface
16
{
17 316
    public function __construct(
18
        private readonly ?ScopeInterface $scope = new Container(),
19
    ) {
20
    }
21
22 315
    public function make(array $context = []): TracerInterface
23
    {
24 315
        return new NullTracer($this->scope);
25
    }
26
}
27