Skip to content

Commit 6576944

Browse files
committed
Fix phpstan errpr
1 parent a644b4b commit 6576944

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Validator/ArrayValidator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public function validate(mixed $value, TypeNode $node, string $context, TypeVali
3838
}
3939

4040
foreach ($value as $k => $v) {
41-
$err = $registry->validate($v, $arrayNode->type, $context . '[' . $k . ']');
41+
$keyStr = (\is_scalar($k) || $k === null) ? (string) $k : get_debug_type($k);
42+
$err = $registry->validate($v, $arrayNode->type, $context . '[' . $keyStr . ']');
4243
if ($err !== null) {
4344
return $err;
4445
}

0 commit comments

Comments
 (0)