kartik-v / yii2-icons

Set of icon frameworks for easy use in Yii Framework 2.0
http://demos.krajee.com/icons
Other
71 stars 29 forks source link

Incompatible API change between 1.4.4 and 1.4.5 #39

Closed meyergru closed 4 years ago

meyergru commented 5 years ago

Steps to reproduce the issue

  1. Include "use kartik\icons\Icon;" and both "Icon::map($this, Icon::ICF);" plus "Icon::map($this, Icon::FI);"
  2. Use "Icon::show('de', [], Icon::FI);" or "Icon::show('globe', [], Icon::ICF);"

Expected behavior and actual behavior

When I follow those steps, I see no flag icon I was expecting... a flag icon! This worked with 1.4.4

Isolating the problem

There has been an incompatible change in the code and in the documentation, too. In 1.4.4, the signature of Icon::show was:

public static function show($name, $options = [], $framework = null, $space = true, $tag = 'i', $fa5 = 'fas')

With 1.4.5, this reads:

public static function show($name, $options = [])

This effectively ignores the third and following parameters in existing calls. I know a workaround, but having to use:

Icon::show('de', ['framework' => Icon::FI]);

is somewhat awkward. Please restore the old behaviour. The only viable other option would be to rename 1.4.5 to 2.0.0 in order to make clear the API change. With the usual composer specification of "^1.4", this breaks existing code by the upgrade to 1.4.5.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.