Skip to content

Commit 657975b

Browse files
authored
fixing homogenous check for attributes with non-numeric keys (#1057)
use reset() instead of trying to get zero array key
1 parent e0b1a01 commit 657975b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Common/Attribute/AttributesBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private function isHomogeneous(array $value): bool
121121
if (count($value) <= 1) {
122122
return true;
123123
}
124-
$type = gettype($value[0]);
124+
$type = gettype(reset($value));
125125
foreach ($value as $v) {
126126
if (in_array(gettype($v), self::NUMERICS) && in_array($type, self::NUMERICS)) {
127127
continue;

0 commit comments

Comments
 (0)