diff options
| author | 2023-04-08 17:37:42 +0200 | |
|---|---|---|
| committer | 2023-04-08 17:37:42 +0200 | |
| commit | 743ca371bbd8c412c2cd4ded6a5a44544abc5a65 (patch) | |
| tree | 7b12b205c09ae335134d4c4ea2d8d9f04fc60e9d /lib/Minz/Log.php | |
| parent | b2ee8a660f719ee3e523988bf536197d4bbe46a1 (diff) | |
PHPStan Level 6 for more files (#5275)
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112
Diffstat (limited to 'lib/Minz/Log.php')
| -rw-r--r-- | lib/Minz/Log.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Minz/Log.php b/lib/Minz/Log.php index 117f231ac..20e8578be 100644 --- a/lib/Minz/Log.php +++ b/lib/Minz/Log.php @@ -19,7 +19,7 @@ class Minz_Log { * @param string $file_name fichier de log * @throws Minz_PermissionDeniedException */ - public static function record ($information, $level, $file_name = null) { + public static function record(string $information, int $level, ?string $file_name = null): void { $env = getenv('FRESHRSS_ENV'); if ($env == '') { try { @@ -78,7 +78,7 @@ class Minz_Log { * @param string $file_name * @throws Minz_PermissionDeniedException */ - protected static function ensureMaxLogSize($file_name) { + protected static function ensureMaxLogSize(string $file_name): void { $maxSize = defined('MAX_LOG_SIZE') ? MAX_LOG_SIZE : 1048576; // @phpstan-ignore-next-line if ($maxSize > 0 && @filesize($file_name) > $maxSize) { @@ -106,16 +106,16 @@ class Minz_Log { * Some helpers to Minz_Log::record() method * Parameters are the same of those of the record() method. */ - public static function debug($msg, $file_name = null) { + public static function debug(string $msg, ?string $file_name = null): void { self::record($msg, LOG_DEBUG, $file_name); } - public static function notice($msg, $file_name = null) { + public static function notice(string $msg, ?string $file_name = null): void { self::record($msg, LOG_NOTICE, $file_name); } - public static function warning($msg, $file_name = null) { + public static function warning(string $msg, ?string $file_name = null): void { self::record($msg, LOG_WARNING, $file_name); } - public static function error($msg, $file_name = null) { + public static function error(string $msg, ?string $file_name = null): void { self::record($msg, LOG_ERR, $file_name); } } |
