Skip to content

Commit 2287198

Browse files
committed
Fix toString() method.
1 parent 68534a8 commit 2287198

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/IsOneOfAssert.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ public function __construct(private array $allowedValues)
2424
*/
2525
public function toString(): string
2626
{
27-
$allowedValues = [];
28-
29-
foreach ($this->allowedValues as $value) {
30-
$this->allowedValues[] = VarDumper::create($value)->asString();
31-
}
27+
$allowedValues = array_map(
28+
static function ($value): string {
29+
return VarDumper::dumpAsString($value);
30+
},
31+
$this->allowedValues,
32+
);
3233

3334
$expectedAsString = implode(', ', $allowedValues);
3435

0 commit comments

Comments
 (0)