@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function getDefaultDriver(): string |
| 27 | 27 | { |
| 28 | - if (!\is_string($this->config['default'])) { |
|
| 28 | + if (!\is_string($this->config['default'])){ |
|
| 29 | 29 | throw new InvalidArgumentException('Default trace driver config value must be a string'); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | * @return class-string<TracerInterface>|Autowire |
| 38 | 38 | * @throws InvalidArgumentException |
| 39 | 39 | */ |
| 40 | - public function geDriverConfig(string $name): string|Autowire |
|
| 40 | + public function geDriverConfig(string $name): string | Autowire |
|
| 41 | 41 | { |
| 42 | - if (!isset($this->config['drivers'][$name])) { |
|
| 42 | + if (!isset($this->config['drivers'][$name])){ |
|
| 43 | 43 | throw new InvalidArgumentException( |
| 44 | 44 | \sprintf('Config for trace `%s` is not defined.', $name) |
| 45 | 45 | ); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $driver = $this->config['drivers'][$name]; |
| 49 | 49 | |
| 50 | - if (!\is_string($driver) && $driver instanceof Autowire) { |
|
| 50 | + if (!\is_string($driver) && $driver instanceof Autowire){ |
|
| 51 | 51 | throw new InvalidArgumentException( |
| 52 | 52 | \sprintf('Trace type value for `%s` must be a string or %s', $name, Autowire::class) |
| 53 | 53 | ); |
@@ -25,7 +25,8 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function getDefaultDriver(): string |
| 27 | 27 | { |
| 28 | - if (!\is_string($this->config['default'])) { |
|
| 28 | + if (!\is_string($this->config['default'])) |
|
| 29 | + { |
|
| 29 | 30 | throw new InvalidArgumentException('Default trace driver config value must be a string'); |
| 30 | 31 | } |
| 31 | 32 | |
@@ -39,7 +40,8 @@ discard block |
||
| 39 | 40 | */ |
| 40 | 41 | public function geDriverConfig(string $name): string|Autowire |
| 41 | 42 | { |
| 42 | - if (!isset($this->config['drivers'][$name])) { |
|
| 43 | + if (!isset($this->config['drivers'][$name])) |
|
| 44 | + { |
|
| 43 | 45 | throw new InvalidArgumentException( |
| 44 | 46 | \sprintf('Config for trace `%s` is not defined.', $name) |
| 45 | 47 | ); |
@@ -47,7 +49,8 @@ discard block |
||
| 47 | 49 | |
| 48 | 50 | $driver = $this->config['drivers'][$name]; |
| 49 | 51 | |
| 50 | - if (!\is_string($driver) && $driver instanceof Autowire) { |
|
| 52 | + if (!\is_string($driver) && $driver instanceof Autowire) |
|
| 53 | + { |
|
| 51 | 54 | throw new InvalidArgumentException( |
| 52 | 55 | \sprintf('Trace type value for `%s` must be a string or %s', $name, Autowire::class) |
| 53 | 56 | ); |
@@ -13,6 +13,6 @@ |
||
| 13 | 13 | public function __construct( |
| 14 | 14 | public readonly string $code, |
| 15 | 15 | public readonly ?string $description = null |
| 16 | - ) { |
|
| 16 | + ){ |
|
| 17 | 17 | } |
| 18 | 18 | } |
@@ -16,14 +16,14 @@ discard block |
||
| 16 | 16 | public function __construct( |
| 17 | 17 | private readonly TelemetryConfig $config, |
| 18 | 18 | private readonly FactoryInterface $factory |
| 19 | - ) { |
|
| 19 | + ){ |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public function getTracer(?string $name = null): TracerInterface |
| 23 | 23 | { |
| 24 | 24 | $name ??= $this->config->getDefaultDriver(); |
| 25 | 25 | |
| 26 | - if (isset($this->drivers[$name])) { |
|
| 26 | + if (isset($this->drivers[$name])){ |
|
| 27 | 27 | return $this->drivers[$name]; |
| 28 | 28 | } |
| 29 | 29 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | $config = $this->config->geDriverConfig($name); |
| 36 | 36 | |
| 37 | - if ($config instanceof Autowire) { |
|
| 37 | + if ($config instanceof Autowire){ |
|
| 38 | 38 | return $config->resolve($this->factory); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -23,7 +23,8 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | $name ??= $this->config->getDefaultDriver(); |
| 25 | 25 | |
| 26 | - if (isset($this->drivers[$name])) { |
|
| 26 | + if (isset($this->drivers[$name])) |
|
| 27 | + { |
|
| 27 | 28 | return $this->drivers[$name]; |
| 28 | 29 | } |
| 29 | 30 | |
@@ -34,7 +35,8 @@ discard block |
||
| 34 | 35 | { |
| 35 | 36 | $config = $this->config->geDriverConfig($name); |
| 36 | 37 | |
| 37 | - if ($config instanceof Autowire) { |
|
| 38 | + if ($config instanceof Autowire) |
|
| 39 | + { |
|
| 38 | 40 | return $config->resolve($this->factory); |
| 39 | 41 | } |
| 40 | 42 | |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | { |
| 14 | 14 | public function __construct( |
| 15 | 15 | private readonly ?ScopeInterface $scope = new Container(), |
| 16 | - ) { |
|
| 16 | + ){ |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function trace( |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | public function __construct( |
| 13 | 13 | private readonly ?FactoryInterface $factory = new Container() |
| 14 | - ) { |
|
| 14 | + ){ |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public function fromContext(?array $context): TracerInterface |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | private readonly ClockInterface $clock, |
| 20 | 20 | LogsInterface $logs, |
| 21 | 21 | string $channel = 'telemetry' |
| 22 | - ) { |
|
| 22 | + ){ |
|
| 23 | 23 | $this->logger = $logs->getLogger($channel); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | public function __construct( |
| 37 | 37 | private readonly ConfiguratorInterface $config |
| 38 | - ) { |
|
| 38 | + ){ |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function init(EnvironmentInterface $env): void |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | /** |
| 47 | 47 | * @param class-string<TracerInterface>|Autowire $driver |
| 48 | 48 | */ |
| 49 | - public function registerTracer(string $name, string|Autowire $driver): void |
|
| 49 | + public function registerTracer(string $name, string | Autowire $driver): void |
|
| 50 | 50 | { |
| 51 | 51 | $this->config->modify( |
| 52 | 52 | TelemetryConfig::CONFIG, |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | public function __construct( |
| 14 | 14 | private string $name, |
| 15 | 15 | private array $attributes = [] |
| 16 | - ) { |
|
| 16 | + ){ |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function getName(): string |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | private readonly CoreInterface $core, |
| 19 | 19 | private readonly ?ScopeInterface $scope = new Container(), |
| 20 | 20 | private readonly ?TracerFactoryInterface $tracerFactory = new TracerFactory(), |
| 21 | - ) { |
|
| 21 | + ){ |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | public function handle( |