Skip to content

Commit c7b7bb8

Browse files
javiereguiluzTobion
authored andcommitted
Use is_iterable() function when possible
1 parent 2c719b1 commit c7b7bb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Serializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function normalize($data, $format = null, array $context = [])
157157
return $data;
158158
}
159159

160-
if (\is_array($data) || $data instanceof \Traversable) {
160+
if (is_iterable($data)) {
161161
if (($context[AbstractObjectNormalizer::PRESERVE_EMPTY_OBJECTS] ?? false) === true && $data instanceof \Countable && 0 === $data->count()) {
162162
return $data;
163163
}

0 commit comments

Comments
 (0)