Skip to content

Commit 236c5a0

Browse files
javiereguiluzTobion
authored andcommitted
Use is_iterable() function when possible
1 parent 3af7c21 commit 236c5a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PropertyAccessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ private function writeCollection(array $zval, string $property, iterable $collec
623623
*/
624624
private function getWriteAccessInfo(string $class, string $property, $value): array
625625
{
626-
$useAdderAndRemover = \is_array($value) || $value instanceof \Traversable;
626+
$useAdderAndRemover = is_iterable($value);
627627
$key = str_replace('\\', '.', $class).'..'.$property.'..'.(int) $useAdderAndRemover;
628628

629629
if (isset($this->writePropertyCache[$key])) {

0 commit comments

Comments
 (0)