diff --git a/src/Instrumentation/CakePHP/src/CakePHPInstrumentation.php b/src/Instrumentation/CakePHP/src/CakePHPInstrumentation.php index b03c4635..9ad4c68c 100644 --- a/src/Instrumentation/CakePHP/src/CakePHPInstrumentation.php +++ b/src/Instrumentation/CakePHP/src/CakePHPInstrumentation.php @@ -8,7 +8,6 @@ use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\Cake\Command\Command; use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\Cake\Controller\Controller; use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\Cake\Http\Server; -use OpenTelemetry\SemConv\TraceAttributes; class CakePHPInstrumentation { @@ -25,4 +24,4 @@ public static function register(): void Controller::hook($instrumentation); Command::hook($instrumentation); } -} \ No newline at end of file +} diff --git a/src/Instrumentation/CakePHP/src/Hooks/Cake/Http/Server.php b/src/Instrumentation/CakePHP/src/Hooks/Cake/Http/Server.php index 63ddfba6..00a67fb8 100644 --- a/src/Instrumentation/CakePHP/src/Hooks/Cake/Http/Server.php +++ b/src/Instrumentation/CakePHP/src/Hooks/Cake/Http/Server.php @@ -6,13 +6,11 @@ use Cake\Routing\Exception\MissingRouteException; use Cake\Routing\Router; -use OpenTelemetry\API\Trace\SpanInterface; use OpenTelemetry\API\Trace\StatusCode; use OpenTelemetry\Context\Context; use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\CakeHook; use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\CakeHookTrait; use function OpenTelemetry\Instrumentation\hook; -use OpenTelemetry\SDK\Common\Time\ClockInterface; use OpenTelemetry\SemConv\TraceAttributes; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; @@ -83,4 +81,4 @@ private function getRouteTemplate($request): string|null return null; } } -} \ No newline at end of file +} diff --git a/src/Instrumentation/CakePHP/src/Hooks/CakeHookTrait.php b/src/Instrumentation/CakePHP/src/Hooks/CakeHookTrait.php index b381c16f..110efc6f 100644 --- a/src/Instrumentation/CakePHP/src/Hooks/CakeHookTrait.php +++ b/src/Instrumentation/CakePHP/src/Hooks/CakeHookTrait.php @@ -44,6 +44,7 @@ public static function hook(CachedInstrumentation $instrumentation): CakeHook * @param string|null $filename * @param int|null $lineno * @return mixed + * @psalm-suppress ArgumentTypeCoercion */ protected function buildSpan(?ServerRequestInterface $request, string $class, string $function, ?string $filename, ?int $lineno): mixed { diff --git a/src/Instrumentation/CakePHP/tests/Integration/CakePHPInstrumentationTest.php b/src/Instrumentation/CakePHP/tests/Integration/CakePHPInstrumentationTest.php index 2c4f82db..bf7468ee 100644 --- a/src/Instrumentation/CakePHP/tests/Integration/CakePHPInstrumentationTest.php +++ b/src/Instrumentation/CakePHP/tests/Integration/CakePHPInstrumentationTest.php @@ -7,7 +7,6 @@ use Cake\TestSuite\IntegrationTestTrait; use OpenTelemetry\API\Trace\SpanKind; use OpenTelemetry\API\Trace\StatusCode; -use OpenTelemetry\SDK\Metrics\Data\Histogram; use OpenTelemetry\SDK\Trace\ImmutableSpan; /** @@ -129,4 +128,4 @@ public function test_response_code_gte_400(): void $attributes = $span->getAttributes()->toArray(); $this->assertSame(400, $attributes['http.response.status_code']); } -} \ No newline at end of file +} diff --git a/src/Instrumentation/CakePHP/tests/Integration/TestCase.php b/src/Instrumentation/CakePHP/tests/Integration/TestCase.php index bec52f10..8a107d86 100644 --- a/src/Instrumentation/CakePHP/tests/Integration/TestCase.php +++ b/src/Instrumentation/CakePHP/tests/Integration/TestCase.php @@ -8,8 +8,6 @@ use OpenTelemetry\API\Instrumentation\Configurator; use OpenTelemetry\API\Trace\Propagation\TraceContextPropagator; use OpenTelemetry\Context\ScopeInterface; -use OpenTelemetry\SDK\Metrics\MeterProvider; -use OpenTelemetry\SDK\Metrics\MetricReader\ExportingReader; use OpenTelemetry\SDK\Trace\ImmutableSpan; use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter; use OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor; @@ -45,4 +43,4 @@ public function tearDown(): void $this->scope->detach(); } -} \ No newline at end of file +}