Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 94253e8

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

File tree

1 file changed

+1
-1
lines changed
Filter options

1 file changed

+1
-1
lines changed

‎src/Symfony/Component/Form/Form.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Form.php
+1-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.