From 30c69ef147059f440d304e7da5e0236d95e424fd Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 4 May 2023 19:47:54 +0200 Subject: Use PHPStan dynamicConstantNames (#5370) https://phpstan.org/config-reference#constants Avoid a few phpstan-ignore-next-line --- lib/Minz/Log.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/Minz/Log.php') diff --git a/lib/Minz/Log.php b/lib/Minz/Log.php index 20e8578be..f30aac7d1 100644 --- a/lib/Minz/Log.php +++ b/lib/Minz/Log.php @@ -56,7 +56,6 @@ class Minz_Log { $log = '[' . date('r') . '] [' . $level_label . '] --- ' . $information . "\n"; - // @phpstan-ignore-next-line if (defined('COPY_LOG_TO_SYSLOG') && COPY_LOG_TO_SYSLOG) { syslog($level, '[' . $username . '] ' . trim($log)); } @@ -80,7 +79,6 @@ class Minz_Log { */ 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) { $fp = fopen($file_name, 'c+'); if ($fp && flock($fp, LOCK_EX)) { @@ -95,10 +93,7 @@ class Minz_Log { } else { throw new Minz_PermissionDeniedException($file_name, Minz_Exception::ERROR); } - // @phpstan-ignore-next-line - if ($fp) { - fclose($fp); - } + fclose($fp); } } -- cgit v1.2.3