aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Log.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-05-04 19:47:54 +0200
committerGravatar GitHub <noreply@github.com> 2023-05-04 19:47:54 +0200
commit30c69ef147059f440d304e7da5e0236d95e424fd (patch)
tree3aeec77db07a4fe23a3721e85dbe5175f98bc2b9 /lib/Minz/Log.php
parent675c56f5799ed92a6aa3a8ad3d3d8d6636f444ec (diff)
Use PHPStan dynamicConstantNames (#5370)
https://phpstan.org/config-reference#constants Avoid a few phpstan-ignore-next-line
Diffstat (limited to 'lib/Minz/Log.php')
-rw-r--r--lib/Minz/Log.php7
1 files changed, 1 insertions, 6 deletions
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);
}
}