-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Compatibility with php-ds/ext-ds #86
Comments
Hi, from what I understand here is what you suggest:
Those sound like very sensible changes. Did I miss anything? |
That is correct. I'm glad to hear that you feel positive about the changes. Do you want me to open PRs for these changes? |
Targeting PHP 7 is definitely a good move honestly, it is time :) |
Sorry I missed that, a PR would be welcome indeed. |
Great. I'll do that next week and let you know. |
What about throwing an exception is it is not an enum. This will make sure implementation errors do not go unnoticed. |
It's of course an option, but I would disagree that passing an object of different type is an implementation error. |
@jacek-foremski agreed, having a |
Was closed automatically by the merge ^^ |
@mnapoli works great, thanks a lot! |
Hello.
I wanted to use this package for my project (BTW good job, it looks very useful).
However I encountered an issue when I tried using it alongside php-ds/ext-ds (https://github.com/php-ds/ext-ds). What I would like to do is to use Enum objects inside Set structure, which by definition should store only unique values. The objects are compared using Hashable interface (https://github.com/php-ds/polyfill/blob/master/src/Hashable.php).
The issue is that my enum should therefore extend your Enum abstract class and implement Hashable at the same time. Unfortunately both have "equals" method declared and there are incompatibilities between the two. Due to how the Enum abstract class is designed, I cannot solve it without redeclaring the abstract enum class completely. The issues are:
I'll probably use my own Enum class for now, but I would like to hear if you would be interested in fixing that issue somehow. I would be glad to help if you do.
The text was updated successfully, but these errors were encountered: