Rinvex Country is a simple and lightweight package for retrieving country details with flexibility. A whole bunch of data including name, demonym, capital, iso codes, dialling codes, geo data, currencies, flags, emoji, and other attributes for all 250 countries worldwide at your fingertips.
[Symfony\Component\Debug\Exception\FatalThrowableError]
Type error: current() expects parameter 1 to be array, null given
[2017-09-12 07:40:18] local.ERROR: Type error: current() expects parameter 1 to be array, null given {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Type error: current() expects parameter 1 to be array, null given at /var/www/projects/translations/vendor/rinvex/country/src/Country.php:249)
Hi Found a case where getTld() throws an error:
Case 1 - Works OK
Case 2 - Works OK
Case 3 - Works OK
Case 4 - Throws the error
The error only occurs for XK - Kosovo, BQ - Caribbean Netherlands and SH - Saint Helena because the get() method returns null.
Replacing
return current($this->get('tld', [])) ?: null;
withreturn $this->get('tld', []) ?: null;
seems to fix the error.Cheers