8000 Only count on arrays or countables to avoid warnings in PHP 7.2 · lostcodder/symfony@94253e8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 94253e8

Browse files
committed
Only count on arrays or countables to avoid warnings in PHP 7.2
1 parent 3113f3f commit 94253e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Form/Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ public function isEmpty()
748748

749749
return FormUtil::isEmpty($this->modelData) ||
750750
// arrays, countables
751-
0 === count($this->modelData) ||
751+
((is_array($this->modelData) || $this->modelData instanceof \Countable) && 0 === count($this->modelData)) ||
752752
// traversables that are not countable
753753
($this->modelData instanceof \Traversable && 0 === iterator_count($this->modelData));
754754
}

0 commit comments

Comments
 (0)
0