From e9619fbb885739a0440cd2a63d28b53dcf9ddba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bar=C3=A1=C5=A1ek?= Date: Sun, 10 Apr 2022 19:42:16 +0200 Subject: [PATCH] Logger: Fix typehints. --- src/SentryLogger.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/SentryLogger.php b/src/SentryLogger.php index e5e8d04..3bee297 100644 --- a/src/SentryLogger.php +++ b/src/SentryLogger.php @@ -29,15 +29,14 @@ public static function register(): void } - /** - * @param mixed $value - * @param string $level - */ - public function log($value, $level = self::INFO): void + public function log(mixed $value, mixed $level = self::INFO): void { $this->fallback->log($value, $level); + if (is_string($level) === false) { + return; + } try { - $this->logToSentry($value, (string) $level); + $this->logToSentry($value, $level); } catch (\Throwable $e) { $this->fallback->log($e, ILogger::CRITICAL); }