Skip to content

Conversation

@ovgray
Copy link
Contributor

@ovgray ovgray commented Dec 11, 2025

Fix php 8.4 deprecation

@reinder83
Copy link
Owner

Thanks for the contribution, i'll check why the pipelines fail, after that we can merge this

@ovgray
Copy link
Contributor Author

ovgray commented Dec 11, 2025

The check is failing because Traits\BinaryFlags::getAllFlags() is marked @return array<int, string> but the code at line 51 would permit the method to return an array with a string key. It appears that was not your intent, because in your example usage the constants are integers, and the code at line 67 would fail if the result of getAllFlags had string keys.

I have modified my pull request by casting $flag to int in line 51 in Traits\BinaryFlags::getAllFlags(). This should fix the falied check.

If instead you want to preserve the apparently inadvertent option of using numeric string constants instead, you would have to change Traits\BinaryFlags::getAllFlags() to @return array<int, string>. You would also have to change Traits\BinaryFlags::getFlagNames() to @return string|array<int|string, string> and cast $carry to int in line 67.

@reinder83 reinder83 merged commit 9844c27 into reinder83:master Dec 11, 2025
2 of 3 checks passed
@ovgray
Copy link
Contributor Author

ovgray commented Dec 11, 2025

Looks like the php 8.0 check failed because the script cannot set it up. Maybe you need to change the php requirement in composer.json to 8.1 and drop the 8.0 check?

@reinder83
Copy link
Owner

Looks like the php 8.0 check failed because the script cannot set it up. Maybe you need to change the php requirement in composer.json to 8.1 and drop the 8.0 check?

I've dropped 8.0 now since it's end of support #14

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