Skip to content

Commit 1def294

Browse files
committed
fix: Falsable
1 parent f89119a commit 1def294

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Utils/Test/src/Fluent/SpanAssertion.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ public function withAttributes(array $attributes): self
229229
/**
230230
* Assert that the span has the expected status.
231231
*
232+
* @psalm-suppress PossiblyUnusedMethod
233+
*
232234
* @param int|Constraint $code The expected status code
233235
* @param string|Constraint|null $description The expected status description
234236
* @throws TraceAssertionFailedException
@@ -592,7 +594,8 @@ private function formatValue($value): string
592594
} elseif (null === $value) {
593595
return 'null';
594596
} elseif (is_array($value)) {
595-
return json_encode($value);
597+
$json = json_encode($value);
598+
return $json === false ? '[unable to encode]' : $json;
596599
}
597600

598601
return (string) $value;

0 commit comments

Comments
 (0)