From 4cc3374f9f6cdd6ea05d4d16942d0165d8b2ed90 Mon Sep 17 00:00:00 2001 From: wn_ Date: Wed, 10 Nov 2021 21:38:25 +0000 Subject: Initial go at PHPStan rule level 6. --- classes/logger.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'classes/logger.php') diff --git a/classes/logger.php b/classes/logger.php index 42ab4452c..ef6173a42 100755 --- a/classes/logger.php +++ b/classes/logger.php @@ -1,6 +1,9 @@ 'E_USER_DEPRECATED', 32767 => 'E_ALL']; - static function log_error(int $errno, string $errstr, string $file, int $line, $context) { + static function log_error(int $errno, string $errstr, string $file, int $line, string $context): bool { return self::get_instance()->_log_error($errno, $errstr, $file, $line, $context); } - private function _log_error($errno, $errstr, $file, $line, $context) { + private function _log_error(int $errno, string $errstr, string $file, int $line, string $context): bool { //if ($errno == E_NOTICE) return false; if ($this->adapter) @@ -38,11 +41,11 @@ class Logger { return false; } - static function log(int $errno, string $errstr, $context = "") { + static function log(int $errno, string $errstr, string $context = ""): bool { return self::get_instance()->_log($errno, $errstr, $context); } - private function _log(int $errno, string $errstr, $context = "") { + private function _log(int $errno, string $errstr, string $context = ""): bool { if ($this->adapter) return $this->adapter->log_error($errno, $errstr, '', 0, $context); else @@ -65,7 +68,7 @@ class Logger { $this->adapter = new Logger_Stdout(); break; default: - $this->adapter = false; + $this->adapter = null; } if ($this->adapter && !implements_interface($this->adapter, "Logger_Adapter")) -- cgit v1.2.3