diff --git a/composer.json b/composer.json index 55d901f..ab9134d 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,8 @@ ], "require": { "php": ">=8.1", - "spiral/boot": "^3.13", - "spiral/core": "^3.13" + "spiral/boot": "^3.14", + "spiral/core": "^3.14" }, "require-dev": { "phpunit/phpunit": "^10.1", @@ -47,7 +47,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.13.x-dev" + "dev-master": "3.14.x-dev" } }, "config": { diff --git a/src/AbstractTracer.php b/src/AbstractTracer.php index ade2fb3..547e3dd 100644 --- a/src/AbstractTracer.php +++ b/src/AbstractTracer.php @@ -4,6 +4,7 @@ namespace Spiral\Telemetry; +use Spiral\Core\Attribute\Proxy; use Spiral\Core\Container; use Spiral\Core\InvokerInterface; use Spiral\Core\ScopeInterface; @@ -16,7 +17,7 @@ abstract class AbstractTracer implements TracerInterface { public function __construct( - private readonly ?ScopeInterface $scope = new Container(), + #[Proxy] private readonly ?ScopeInterface $scope = new Container(), ) { } @@ -25,6 +26,7 @@ public function __construct( */ final protected function runScope(Span $span, callable $callback): mixed { + // TODO: Can we remove this scope? return $this->scope->runScope([ SpanInterface::class => $span, TracerInterface::class => $this, diff --git a/src/LogTracerFactory.php b/src/LogTracerFactory.php index cb1c0ab..0efbaaa 100644 --- a/src/LogTracerFactory.php +++ b/src/LogTracerFactory.php @@ -6,6 +6,7 @@ use Psr\Log\LoggerInterface; use Ramsey\Uuid\UuidFactory; +use Spiral\Core\Attribute\Proxy; use Spiral\Core\ScopeInterface; use Spiral\Logger\LogsInterface; @@ -21,7 +22,7 @@ final class LogTracerFactory implements TracerFactoryInterface private readonly LoggerInterface $logger; public function __construct( - private readonly ScopeInterface $scope, + #[Proxy] private readonly ScopeInterface $scope, private readonly ClockInterface $clock, LogsInterface $logs, string $channel = self::LOG_CHANNEL diff --git a/src/NullTracerFactory.php b/src/NullTracerFactory.php index ff47882..26fe07c 100644 --- a/src/NullTracerFactory.php +++ b/src/NullTracerFactory.php @@ -4,6 +4,7 @@ namespace Spiral\Telemetry; +use Spiral\Core\Attribute\Proxy; use Spiral\Core\Container; use Spiral\Core\ScopeInterface; @@ -15,7 +16,7 @@ final class NullTracerFactory implements TracerFactoryInterface { public function __construct( - private readonly ?ScopeInterface $scope = new Container(), + #[Proxy] private readonly ?ScopeInterface $scope = new Container(), ) { }