Fixes #17156: Fixes PHP 7.2 warning when a data provider has no data as a parameter for a GridView

This commit is contained in:
evilito
2019-02-28 03:02:08 -05:00
committed by Alexander Makarov
parent b77e3ea0e7
commit 8cc74f5c57
2 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ class ArrayDataProvider extends BaseDataProvider
*/
protected function prepareTotalCount()
{
return count($this->allModels);
return is_array($this->allModels) ? count($this->allModels) : 0;
}
/**