Skip to content

Commit

Permalink
fixing cakephp psalm complaints (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettmc authored Aug 30, 2024
1 parent b10cb8d commit 15427f3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/Instrumentation/CakePHP/src/CakePHPInstrumentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -25,4 +24,4 @@ public static function register(): void
Controller::hook($instrumentation);
Command::hook($instrumentation);
}
}
}
4 changes: 1 addition & 3 deletions src/Instrumentation/CakePHP/src/Hooks/Cake/Http/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -83,4 +81,4 @@ private function getRouteTemplate($request): string|null
return null;
}
}
}
}
1 change: 1 addition & 0 deletions src/Instrumentation/CakePHP/src/Hooks/CakeHookTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -129,4 +128,4 @@ public function test_response_code_gte_400(): void
$attributes = $span->getAttributes()->toArray();
$this->assertSame(400, $attributes['http.response.status_code']);
}
}
}
4 changes: 1 addition & 3 deletions src/Instrumentation/CakePHP/tests/Integration/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -45,4 +43,4 @@ public function tearDown(): void

$this->scope->detach();
}
}
}

0 comments on commit 15427f3

Please sign in to comment.