Skip to content

Commit 15427f3

Browse files
authored
fixing cakephp psalm complaints (#289)
1 parent b10cb8d commit 15427f3

File tree

5 files changed

+5
-10
lines changed

5 files changed

+5
-10
lines changed

src/Instrumentation/CakePHP/src/CakePHPInstrumentation.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\Cake\Command\Command;
99
use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\Cake\Controller\Controller;
1010
use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\Cake\Http\Server;
11-
use OpenTelemetry\SemConv\TraceAttributes;
1211

1312
class CakePHPInstrumentation
1413
{
@@ -25,4 +24,4 @@ public static function register(): void
2524
Controller::hook($instrumentation);
2625
Command::hook($instrumentation);
2726
}
28-
}
27+
}

src/Instrumentation/CakePHP/src/Hooks/Cake/Http/Server.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66

77
use Cake\Routing\Exception\MissingRouteException;
88
use Cake\Routing\Router;
9-
use OpenTelemetry\API\Trace\SpanInterface;
109
use OpenTelemetry\API\Trace\StatusCode;
1110
use OpenTelemetry\Context\Context;
1211
use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\CakeHook;
1312
use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\CakeHookTrait;
1413
use function OpenTelemetry\Instrumentation\hook;
15-
use OpenTelemetry\SDK\Common\Time\ClockInterface;
1614
use OpenTelemetry\SemConv\TraceAttributes;
1715
use Psr\Http\Message\ResponseInterface;
1816
use Psr\Http\Message\ServerRequestInterface;
@@ -83,4 +81,4 @@ private function getRouteTemplate($request): string|null
8381
return null;
8482
}
8583
}
86-
}
84+
}

src/Instrumentation/CakePHP/src/Hooks/CakeHookTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public static function hook(CachedInstrumentation $instrumentation): CakeHook
4444
* @param string|null $filename
4545
* @param int|null $lineno
4646
* @return mixed
47+
* @psalm-suppress ArgumentTypeCoercion
4748
*/
4849
protected function buildSpan(?ServerRequestInterface $request, string $class, string $function, ?string $filename, ?int $lineno): mixed
4950
{

src/Instrumentation/CakePHP/tests/Integration/CakePHPInstrumentationTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Cake\TestSuite\IntegrationTestTrait;
88
use OpenTelemetry\API\Trace\SpanKind;
99
use OpenTelemetry\API\Trace\StatusCode;
10-
use OpenTelemetry\SDK\Metrics\Data\Histogram;
1110
use OpenTelemetry\SDK\Trace\ImmutableSpan;
1211

1312
/**
@@ -129,4 +128,4 @@ public function test_response_code_gte_400(): void
129128
$attributes = $span->getAttributes()->toArray();
130129
$this->assertSame(400, $attributes['http.response.status_code']);
131130
}
132-
}
131+
}

src/Instrumentation/CakePHP/tests/Integration/TestCase.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
use OpenTelemetry\API\Instrumentation\Configurator;
99
use OpenTelemetry\API\Trace\Propagation\TraceContextPropagator;
1010
use OpenTelemetry\Context\ScopeInterface;
11-
use OpenTelemetry\SDK\Metrics\MeterProvider;
12-
use OpenTelemetry\SDK\Metrics\MetricReader\ExportingReader;
1311
use OpenTelemetry\SDK\Trace\ImmutableSpan;
1412
use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter;
1513
use OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor;
@@ -45,4 +43,4 @@ public function tearDown(): void
4543

4644
$this->scope->detach();
4745
}
48-
}
46+
}

0 commit comments

Comments
 (0)