-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Hotfix/ability to create invalid enums #12
Hotfix/ability to create invalid enums #12
Conversation
…ity-to-create-invalid-enums Conflicts: src/Enum.php
/** | ||
* @see https://github.com/myclabs/php-enum/issues/9 | ||
*/ | ||
$this->assertEquals(EnumFixture::PROBLEMATIC_NUMBER, EnumFixture::search(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we search for 1
and we check it returns PROBLEMATIC_NUMBER
whose value is 0
, is that normal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not normal. I've just added that so that I could reference it in another bug ticket, since search() method is also not type safe. I'll fix that soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK so we leave it that way for now but you are planning to fix it?
Very good stuff! |
[EnumFixture::FOO, new EnumFixture(EnumFixture::FOO)], | ||
[EnumFixture::BAR, new EnumFixture(EnumFixture::BAR)], | ||
[(string) EnumFixture::NUMBER, new EnumFixture(EnumFixture::NUMBER)], | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to keep BC with PHP 5.3 (yeah I know -_-)
Tests are failing because of that.
…-enums Hotfix/ability to create invalid enums
Done:
@mnapoli please have a look.