After upgrading to PHP 7.2 I get a lot of Warnings
Parameter must be an array or an object that implements Countable
I've tried many ways to fix it but none have worked so far. The commented lines below are my attempts. How can I fix this?
$bannerGroupCode = $this->getBannerGroupCode();
$data = $this->getDataByGroupCode($bannerGroupCode);
$bannerGroupData = $data['group_data'];
$template = '';
if (count($bannerGroupData) > 0):
// if (empty($bannerGroupData)):
// if ($bannerGroupData && count($bannerGroupData) >= 0):
// if (is_array($bannerGroupData) && count($bannerGroupData) > 0):
// if (strlen($bannerGroupData) > 0):
$prebaneff = $bannerGroupData->getPreBannerEffects();
$bannerType = $bannerGroupData->getAnimationType();
((is_object($bannerGroupData) || is_array($bannerGroupData)) && count($bannerGroupData) > 0)
?