Skip to content

Commit 7600673

Browse files
committed
Use Stringable interface in HttpClientAssertionsTrait
1 parent 01aae23 commit 7600673

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Codeception/Module/Symfony/HttpClientAssertionsTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Codeception\Module\Symfony;
66

77
use PHPUnit\Framework\Assert;
8+
use Stringable;
89
use Symfony\Component\HttpClient\DataCollector\HttpClientDataCollector;
910
use Symfony\Component\VarDumper\Cloner\Data;
1011

@@ -149,7 +150,7 @@ private function extractValue(mixed $value): mixed
149150
return match (true) {
150151
$value instanceof Data => $value->getValue(true),
151152
is_object($value) && method_exists($value, 'getValue') => $value->getValue(true),
152-
is_object($value) && method_exists($value, '__toString') => (string) $value,
153+
$value instanceof Stringable => (string) $value,
153154
default => $value,
154155
};
155156
}

0 commit comments

Comments
 (0)