dolejska-daniel / riot-api

Riot League of Legends & DataDragon API wrappers for PHP7 and PHP8.
GNU General Public License v3.0
113 stars 25 forks source link

Confusing typing in ChampionMasteryDto #33

Closed TheKeymaster closed 5 years ago

TheKeymaster commented 5 years ago

Describe the bug In \RiotAPI\LeagueAPI\Objects\ChampionMasteryDto::$championId the typing is float, but champion Ids are integers. This is problematic because PHP does not support floating numbers for keys as arrays and you might get a warning in your IDE.

To Reproduce Steps to reproduce the behavior:

Not relevant.

dolejska-daniel commented 5 years ago

Hey @TheKeymaster, the problem goes like this: ChampionID is defined as long in Riot's API documentation, but PHP stores big ints as floats.

It is no problem to say it's int and it should be int but it could happen that it's gonna be something else - as it happend with MatchIDs (they are integer values but are stored as floats, should we call them ints or floats?).

dolejska-daniel commented 5 years ago

But I guess it makes a lot more sense to be marked as integer rather than float. How dumb of me :joy_cat:.