diff --git a/src/Instrumentation/CakePHP/src/Hooks/Cake/Command/Command.php b/src/Instrumentation/CakePHP/src/Hooks/Cake/Command/Command.php index 262b3a546..9838963b1 100644 --- a/src/Instrumentation/CakePHP/src/Hooks/Cake/Command/Command.php +++ b/src/Instrumentation/CakePHP/src/Hooks/Cake/Command/Command.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\Cake\Command; +namespace OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\Cake\Command; use OpenTelemetry\API\Trace\Span; use OpenTelemetry\API\Trace\StatusCode; diff --git a/src/Instrumentation/CakePHP/src/Hooks/Cake/Http/Server.php b/src/Instrumentation/CakePHP/src/Hooks/Cake/Http/Server.php index 00a67fb8f..c7f05ad87 100644 --- a/src/Instrumentation/CakePHP/src/Hooks/Cake/Http/Server.php +++ b/src/Instrumentation/CakePHP/src/Hooks/Cake/Http/Server.php @@ -45,7 +45,7 @@ public function instrument(): void $route = $this->getRouteTemplate($request); $span = \OpenTelemetry\API\Trace\Span::fromContext($scope->context()); - if($route && $this->isRoot()) { + if ($route && $this->isRoot()) { $span->setAttribute(TraceAttributes::HTTP_ROUTE, $route); } if ($exception) { diff --git a/src/Instrumentation/CakePHP/tests/Integration/App/config/app.php b/src/Instrumentation/CakePHP/tests/Integration/App/config/app.php index 0854b2db4..c9fe812fe 100644 --- a/src/Instrumentation/CakePHP/tests/Integration/App/config/app.php +++ b/src/Instrumentation/CakePHP/tests/Integration/App/config/app.php @@ -173,7 +173,9 @@ 'skipLog' => [], 'log' => true, 'trace' => true, - 'ignoredDeprecationPaths' => [], + 'ignoredDeprecationPaths' => [ + '/src/I18n/I18n.php', + ], ], /* diff --git a/src/Instrumentation/Laravel/src/Watchers/LogWatcher.php b/src/Instrumentation/Laravel/src/Watchers/LogWatcher.php index f64ed3aee..7bacfa70a 100644 --- a/src/Instrumentation/Laravel/src/Watchers/LogWatcher.php +++ b/src/Instrumentation/Laravel/src/Watchers/LogWatcher.php @@ -6,12 +6,14 @@ use Illuminate\Contracts\Foundation\Application; use Illuminate\Log\Events\MessageLogged; +use Illuminate\Log\LogManager; use OpenTelemetry\API\Instrumentation\CachedInstrumentation; use OpenTelemetry\API\Logs\LogRecord; use OpenTelemetry\API\Logs\Map\Psr3; class LogWatcher extends Watcher { + private LogManager $logger; public function __construct( private CachedInstrumentation $instrumentation, ) { diff --git a/src/Instrumentation/Psr16/tests/Integration/Psr16InstrumentationTest.php b/src/Instrumentation/Psr16/tests/Integration/Psr16InstrumentationTest.php index 9058e79af..79df78b30 100644 --- a/src/Instrumentation/Psr16/tests/Integration/Psr16InstrumentationTest.php +++ b/src/Instrumentation/Psr16/tests/Integration/Psr16InstrumentationTest.php @@ -204,7 +204,7 @@ private function createMemoryCacheAdapter(): CacheInterface protected function checkKey(string $key):string { - if(empty($key)) { + if (empty($key)) { throw new \InvalidArgumentException('cache key is empty'); } @@ -213,11 +213,11 @@ protected function checkKey(string $key):string protected function getTTL(DateInterval|int|null $ttl):?int { - if($ttl instanceof DateInterval) { + if ($ttl instanceof DateInterval) { return ((new DateTime())->add($ttl)->getTimeStamp() - time()); } - if((is_int($ttl) && $ttl > 0)) { + if ((is_int($ttl) && $ttl > 0)) { return $ttl; } @@ -226,7 +226,7 @@ protected function getTTL(DateInterval|int|null $ttl):?int protected function fromIterable(iterable $data): array { - if(is_array($data)) { + if (is_array($data)) { return $data; } @@ -235,8 +235,8 @@ protected function fromIterable(iterable $data): array protected function checkReturn(array $booleans): bool { - foreach($booleans as $boolean) { - if(!(bool) $boolean) { + foreach ($booleans as $boolean) { + if (!(bool) $boolean) { return false; } } @@ -248,8 +248,8 @@ public function get(string $key, mixed $default = null): mixed { $key = $this->checkKey($key); - if(isset($this->data[$key])) { - if($this->data[$key]['ttl'] === null || $this->data[$key]['ttl'] > time()) { + if (isset($this->data[$key])) { + if ($this->data[$key]['ttl'] === null || $this->data[$key]['ttl'] > time()) { return $this->data[$key]['content']; } @@ -263,7 +263,7 @@ public function set(string $key, mixed $value, null|int|\DateInterval $ttl = nul { $ttl = $this->getTTL($ttl); - if($ttl !== null) { + if ($ttl !== null) { $ttl = (time() + $ttl); } diff --git a/src/Instrumentation/Psr3/src/Formatter.php b/src/Instrumentation/Psr3/src/Formatter.php index 520648dee..2fcdc8e0a 100644 --- a/src/Instrumentation/Psr3/src/Formatter.php +++ b/src/Instrumentation/Psr3/src/Formatter.php @@ -24,7 +24,7 @@ public static function format(array $context): array public static function formatThrowable(?Throwable $exception): array { - if($exception) { + if ($exception) { return [ 'message' => $exception->getMessage(), 'code' => $exception->getCode(), diff --git a/src/Instrumentation/Psr6/tests/Integration/Psr6InstrumentationTest.php b/src/Instrumentation/Psr6/tests/Integration/Psr6InstrumentationTest.php index 21caba446..30c6374e9 100644 --- a/src/Instrumentation/Psr6/tests/Integration/Psr6InstrumentationTest.php +++ b/src/Instrumentation/Psr6/tests/Integration/Psr6InstrumentationTest.php @@ -213,7 +213,7 @@ private function createMemoryCacheAdapter(): CacheItemPoolInterface protected function checkKey(string $key):string { - if(empty($key)) { + if (empty($key)) { throw new \InvalidArgumentException('cache key is empty'); }