vsch / laravel-translation-manager

Enhanced Management of Laravel 4 & 5 Translations, with Yandex Translation API assisted translations.
MIT License
181 stars 84 forks source link

count(): Parameter must be an array or an object that implements Countable #120

Closed pilis closed 6 years ago

pilis commented 6 years ago

When I call php artisan translations:export <whatever> I get In TranslationFileRewriter.php line 111: count(): Parameter must be an array or an object that implements Countable.

I'm using Laravel 5.5 with "vsch/laravel-translation-manager": "~2.5".

I tried to investigate why it's that and I come down with the $chars param eqals string with new line only. I have been using this package so far, but after update this happened.

vsch commented 6 years ago

@piotr-pilis, I will take a look at the code for ~2.5. The issue was fixed in ~2.6 branch.

The changes are caused by PHP 7 changes which only return count() for an array or object so the condition needs to test first if the param is an array before using count(). Previous versions of PHP had no issue with this.

vsch commented 6 years ago

@piotr-pilis, fixed by #122, new version released 2.5.8