Преглед на файлове

openlog never fails on php8.2 so remove check

Jordi Boggiano преди 2 години
родител
ревизия
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
 			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\\)\\.$#"
 			count: 4

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

@@ -58,9 +58,7 @@ class SyslogHandler extends AbstractSyslogHandler
      */
     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);
     }
 }