Dolphiq / craft3-iconpicker

Craft plugin that provides a new field type that offers end users an easy way to pick an icon from a .woff or .ttf font file. You can easily use ionicons or font awesome icons or any other compatible font file.
MIT License
16 stars 11 forks source link

PHP 7.2 issue > count(null) #10

Closed ostark closed 6 years ago

ostark commented 6 years ago

In PHP 7.2 counting non-countable types throws a warning: http://php.net/manual/de/migration72.incompatible.php#migration72.incompatible.warn-on-non-countable-types

$icons can be type of array or null https://github.com/Dolphiq/craft3-iconpicker/blob/efadc1359ad4ae4fc90e2bbaeda28f58b28f10d6/src/fields/Iconpicker.php#L212-L214

This additional check should prevent this warning

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