From 1790eeefc98ac5a0c5495a6ab020dfb679d11215 Mon Sep 17 00:00:00 2001 From: watscho <35995947+watscho@users.noreply.github.com> Date: Wed, 7 Mar 2018 12:11:59 +0400 Subject: [PATCH] Update Countries.php Fix : sizeof(): Parameter must be an array or an object that implements Countable --- src/Webpatser/Countries/Countries.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Webpatser/Countries/Countries.php b/src/Webpatser/Countries/Countries.php index ca21d19..0491294 100644 --- a/src/Webpatser/Countries/Countries.php +++ b/src/Webpatser/Countries/Countries.php @@ -40,7 +40,7 @@ public function __construct() protected function getCountries() { //Get the countries from the JSON file - if (sizeof($this->countries) == 0){ + if (!$this->countries || sizeof($this->countries) == 0){ $this->countries = json_decode(file_get_contents(__DIR__ . '/Models/countries.json'), true); }