Просмотр исходного кода

openlog never fails on php8.2 so remove check

Jordi Boggiano 2 лет назад
Родитель
Сommit
50409b8169
2 измененных файлов с 1 добавлено и 8 удалено
  1. 0 5
      phpstan-baseline.neon
  2. 1 3
      src/Monolog/Handler/SyslogHandler.php

+ 0 - 5
phpstan-baseline.neon

@@ -50,11 +50,6 @@ parameters:
 			count: 1
 			count: 1
 			path: src/Monolog/Handler/MandrillHandler.php
 			path: src/Monolog/Handler/MandrillHandler.php
 
 
-		-
-			message: "#^Negated boolean expression is always false\\.$#"
-			count: 1
-			path: src/Monolog/Handler/SyslogHandler.php
-
 		-
 		-
 			message: "#^Variable property access on \\$this\\(Monolog\\\\LogRecord\\)\\.$#"
 			message: "#^Variable property access on \\$this\\(Monolog\\\\LogRecord\\)\\.$#"
 			count: 4
 			count: 4

+ 1 - 3
src/Monolog/Handler/SyslogHandler.php

@@ -58,9 +58,7 @@ class SyslogHandler extends AbstractSyslogHandler
      */
      */
     protected function write(LogRecord $record): void
     protected function write(LogRecord $record): void
     {
     {
-        if (!openlog($this->ident, $this->logopts, $this->facility)) {
-            throw new \LogicException('Can\'t open syslog for ident "'.$this->ident.'" and facility "'.$this->facility.'"' . Utils::getRecordMessageForException($record));
-        }
+        openlog($this->ident, $this->logopts, $this->facility);
         syslog($this->toSyslogPriority($record->level), (string) $record->formatted);
         syslog($this->toSyslogPriority($record->level), (string) $record->formatted);
     }
     }
 }
 }