Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix laminas#38
Browse files Browse the repository at this point in the history
misterabdul authored and Ocramius committed Jul 22, 2022

Verified

This commit was signed with the committer’s verified signature.
sandhose Quentin Gliech
1 parent b1b2950 commit 5f7d124
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Formatter/Simple.php
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
use Laminas\Log\Exception;
use Traversable;

use function array_key_exists;
use function count;
use function is_array;
use function is_string;
@@ -65,7 +66,7 @@ public function format($event)

$event = parent::format($event);
foreach ($event as $name => $value) {
if ('extra' === $name && count($value)) {
if ('extra' === $name && is_array($value) && count($value)) {
$value = $this->normalize($value);
} elseif ('extra' === $name) {
// Don't print an empty array
@@ -75,7 +76,7 @@ public function format($event)
}

if (
isset($event['extra']) && empty($event['extra'])
array_key_exists('extra', $event) && empty($event['extra'])
&& false !== strpos($this->format, '%extra%')
) {
$output = rtrim($output, ' ');

0 comments on commit 5f7d124

Please sign in to comment.