Skip to content

Commit 3343fd3

Browse files
authored
Merge pull request #20039 from terabytesoftw/fix-isoneofassert
Fix `IsOneOfAssert::toString()` method.
2 parents 563fd2f + 2287198 commit 3343fd3

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)