summaryrefslogtreecommitdiff
path: root/classes/logger.php
diff options
context:
space:
mode:
authorwn_ <[email protected]>2021-11-10 21:38:25 +0000
committerwn_ <[email protected]>2021-11-10 21:38:25 +0000
commit4cc3374f9f6cdd6ea05d4d16942d0165d8b2ed90 (patch)
tree00f0ff6ba464d3b7741b9f0bb36c306d329d6836 /classes/logger.php
parent87a30d88d36941ad817f0d1409e2ededbe576af6 (diff)
Initial go at PHPStan rule level 6.
Diffstat (limited to 'classes/logger.php')
-rwxr-xr-xclasses/logger.php13
1 files changed, 8 insertions, 5 deletions
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 @@
<?php
class Logger {
+ /** @var Logger|null */
private static $instance;
+
+ /** @var Logger_Adapter|null */
private $adapter;
const LOG_DEST_SQL = "sql";
@@ -25,11 +28,11 @@ class Logger {
16384 => '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"))