@@ -11,8 +11,8 @@ |
||
| 11 | 11 | * @param non-empty-string|null $description |
| 12 | 12 | */ |
| 13 | 13 | public function __construct( |
| 14 | - public readonly string|int $code, |
|
| 14 | + public readonly string | int $code, |
|
| 15 | 15 | public readonly ?string $description = null |
| 16 | - ) { |
|
| 16 | + ){ |
|
| 17 | 17 | } |
| 18 | 18 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | public function __construct( |
| 13 | 13 | private readonly ?ScopeInterface $scope = new Container(), |
| 14 | - ) { |
|
| 14 | + ){ |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public function make(array $context = []): TracerInterface |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | public function __construct( |
| 38 | 38 | private readonly ConfiguratorInterface $config |
| 39 | - ) { |
|
| 39 | + ){ |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | public function init(EnvironmentInterface $env): void |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | /** |
| 48 | 48 | * @param class-string<TracerFactoryInterface>|TracerFactoryInterface|Autowire $driver |
| 49 | 49 | */ |
| 50 | - public function registerTracer(string $name, string|TracerFactoryInterface|Autowire $driver): void |
|
| 50 | + public function registerTracer(string $name, string | TracerFactoryInterface | Autowire $driver): void |
|
| 51 | 51 | { |
| 52 | 52 | $this->config->modify( |
| 53 | 53 | TelemetryConfig::CONFIG, |
@@ -22,7 +22,8 @@ |
||
| 22 | 22 | |
| 23 | 23 | $context = $tracer->getContext(); |
| 24 | 24 | |
| 25 | - if (!empty($context)) { |
|
| 25 | + if (!empty($context)) |
|
| 26 | + { |
|
| 26 | 27 | $record['extra']['telemetry'] = $context; |
| 27 | 28 | } |
| 28 | 29 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | { |
| 13 | 13 | public function __construct( |
| 14 | 14 | private readonly ContainerInterface $container |
| 15 | - ) { |
|
| 15 | + ){ |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | public function __invoke(array $record): array |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | $context = $tracer->getContext(); |
| 24 | 24 | |
| 25 | - if (!empty($context)) { |
|
| 25 | + if (!empty($context)){ |
|
| 26 | 26 | $record['extra']['telemetry'] = $context; |
| 27 | 27 | } |
| 28 | 28 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | * @param non-empty-string|int $code |
| 29 | 29 | * @param non-empty-string|null $description |
| 30 | 30 | */ |
| 31 | - public function setStatus(string|int $code, string $description = null): self; |
|
| 31 | + public function setStatus(string | int $code, string $description = null): self; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Get the current span status. |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | { |
| 18 | 18 | public function __construct( |
| 19 | 19 | private readonly ?ScopeInterface $scope = new Container(), |
| 20 | - ) { |
|
| 20 | + ){ |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -28,6 +28,6 @@ discard block |
||
| 28 | 28 | return $this->scope->runScope([ |
| 29 | 29 | SpanInterface::class => $span, |
| 30 | 30 | TracerInterface::class => $this, |
| 31 | - ], static fn (InvokerInterface $invoker): mixed => $invoker->invoke($callback)); |
|
| 31 | + ], static fn (InvokerInterface $invoker) : mixed => $invoker->invoke($callback)); |
|
| 32 | 32 | } |
| 33 | 33 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | private readonly ClockInterface $clock, |
| 24 | 24 | private readonly LoggerInterface $logger, |
| 25 | 25 | private readonly UuidFactoryInterface $uuidFactory |
| 26 | - ) { |
|
| 26 | + ){ |
|
| 27 | 27 | parent::__construct($scope); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | $tracerFactory->shouldReceive('make') |
| 23 | 23 | ->once() |
| 24 | 24 | ->with(['some' => 'data']) |
| 25 | - ->andReturn( $tracer = new NullTracer()); |
|
| 25 | + ->andReturn($tracer = new NullTracer()); |
|
| 26 | 26 | |
| 27 | 27 | $handler = new Handler( |
| 28 | 28 | core: $core = m::mock(CoreInterface::class), |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | private readonly ResponseFactoryInterface $responseFactory, |
| 33 | 33 | private readonly ContainerInterface $container, |
| 34 | 34 | ?TracerFactoryInterface $tracerFactory = null |
| 35 | - ) { |
|
| 36 | - foreach ($this->config->getMiddleware() as $middleware) { |
|
| 35 | + ){ |
|
| 36 | + foreach ($this->config->getMiddleware() as $middleware){ |
|
| 37 | 37 | $this->pipeline->pushMiddleware($this->container->get($middleware)); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | return $this->pipeline; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - public function setHandler(callable|RequestHandlerInterface $handler): self |
|
| 49 | + public function setHandler(callable | RequestHandlerInterface $handler): self |
|
| 50 | 50 | { |
| 51 | 51 | $this->handler = $handler instanceof RequestHandlerInterface |
| 52 | 52 | ? $handler |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $dispatcher?->dispatch(new RequestReceived($request)); |
| 69 | 69 | |
| 70 | - if ($this->handler === null) { |
|
| 70 | + if ($this->handler === null){ |
|
| 71 | 71 | throw new HttpException('Unable to run HttpCore, no handler is set.'); |
| 72 | 72 | } |
| 73 | 73 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | traceKind: TraceKind::SERVER |
| 105 | 105 | ); |
| 106 | 106 | |
| 107 | - foreach ($tracer->getContext() as $key => $value) { |
|
| 107 | + foreach ($tracer->getContext() as $key => $value){ |
|
| 108 | 108 | $response = $response->withHeader($key, $value); |
| 109 | 109 | } |
| 110 | 110 | |
@@ -33,7 +33,8 @@ discard block |
||
| 33 | 33 | private readonly ContainerInterface $container, |
| 34 | 34 | ?TracerFactoryInterface $tracerFactory = null |
| 35 | 35 | ) { |
| 36 | - foreach ($this->config->getMiddleware() as $middleware) { |
|
| 36 | + foreach ($this->config->getMiddleware() as $middleware) |
|
| 37 | + { |
|
| 37 | 38 | $this->pipeline->pushMiddleware($this->container->get($middleware)); |
| 38 | 39 | } |
| 39 | 40 | |
@@ -67,7 +68,8 @@ discard block |
||
| 67 | 68 | |
| 68 | 69 | $dispatcher?->dispatch(new RequestReceived($request)); |
| 69 | 70 | |
| 70 | - if ($this->handler === null) { |
|
| 71 | + if ($this->handler === null) |
|
| 72 | + { |
|
| 71 | 73 | throw new HttpException('Unable to run HttpCore, no handler is set.'); |
| 72 | 74 | } |
| 73 | 75 | |
@@ -104,7 +106,8 @@ discard block |
||
| 104 | 106 | traceKind: TraceKind::SERVER |
| 105 | 107 | ); |
| 106 | 108 | |
| 107 | - foreach ($tracer->getContext() as $key => $value) { |
|
| 109 | + foreach ($tracer->getContext() as $key => $value) |
|
| 110 | + { |
|
| 108 | 111 | $response = $response->withHeader($key, $value); |
| 109 | 112 | } |
| 110 | 113 | |