1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-08 06:06:40 +02:00

FingersCrossedHandler: Clean up code

This commit is contained in:
Nils Adermann
2016-04-20 15:00:33 -04:00
parent e7c326782f
commit 0fc6734c6f

View File

@@ -88,10 +88,7 @@ class FingersCrossedHandler extends AbstractHandler
$this->buffering = false; $this->buffering = false;
} }
if (!$this->handler instanceof HandlerInterface) { if (!$this->handler instanceof HandlerInterface) {
$record = end($this->buffer); $record = end($this->buffer) ?: null;
if ($record === false) {
$record = null;
}
$this->handler = call_user_func($this->handler, $record, $this); $this->handler = call_user_func($this->handler, $record, $this);
if (!$this->handler instanceof HandlerInterface) { if (!$this->handler instanceof HandlerInterface) {
@@ -119,7 +116,7 @@ class FingersCrossedHandler extends AbstractHandler
array_shift($this->buffer); array_shift($this->buffer);
} }
if ($this->activationStrategy->isHandlerActivated($record)) { if ($this->activationStrategy->isHandlerActivated($record)) {
$this->activate($record); $this->activate();
} }
} else { } else {
$this->handler->handle($record); $this->handler->handle($record);