planetteamspeak / ts3phpframework

Modern use-at-will framework that provides individual components to manage TeamSpeak 3 Server instances
https://www.planetteamspeak.com
GNU General Public License v3.0
209 stars 59 forks source link

`toInt()` should only return int #192

Closed Sebbo94BY closed 1 year ago

Sebbo94BY commented 1 year ago

When the function is called to int, I would expect, that this function only returns int and not also float.

Relates to #191 and maybe should be in one commit.

ronindesign commented 1 year ago

Hmm, my intuition tells me this may be more complicated. There's seems to be a reason/scenario for when a float should be returned (i.e. greater than 32bit int implies string is actually a float value I believe, but I may misunderstand)

Due to the explicitely designed nature of this, I'm not certain the ts3server doesn't return float values in some cases... I'll need to revew this further. Maybe we can test if there is a case that results in an icon ID being a float (or greater than a 32bit Int)?

Sebbo94BY commented 1 year ago

Yeah, some more PHPUnit tests would be very helpful - also for future PHP upgrades and code changes.

I've never really checked these icon IDs, but as far as I know, those IDs are only integers, never floats. I've never seen any icon ID, which was a float. But no gurantee on that. 😅

Sebbo94BY commented 1 year ago

Ok, the function Node::iconGetName() currently returns for example 3525880661.0. Also see #191 for further information.

Sebbo94BY commented 1 year ago

@ronindesign how do we want to proceed with this topic?

ronindesign commented 1 year ago

Merging this and closing #190 as this should resolve.