Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toInt() should only return int #192

Conversation

Sebbo94BY
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

@Sebbo94BY
Copy link
Collaborator Author

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

@ronindesign ronindesign merged commit d754be6 into planetteamspeak:dev Aug 3, 2023
@Sebbo94BY Sebbo94BY deleted the Change-toInt-function-to-what-it-says branch August 3, 2023 20:01
@ronindesign
Copy link
Collaborator

ronindesign commented Aug 3, 2023

Merging this and closing #190 as this should resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants