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

NullTracerFactory::make()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
nc 1
nop 1
crap 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