Skip to content

Fix validating key with null value #81

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

Merged
merged 1 commit into from
Oct 30, 2018

Conversation

KartaviK
Copy link
Contributor

I found another bug:

If my enumeration contains a constant with the value "null", then the isValidKey() method incorrectly checks the validity:

<?php

final class MyEnum extends \MyCLabs\Enum\Enum
{
    public const UNDEFINED = null;
}

$valid = MyEnum::isValidKey('UNDEFINED'); // will return false because of `isset` checking

@mnapoli mnapoli added the bug label Oct 30, 2018
@mnapoli
Copy link
Member

mnapoli commented Oct 30, 2018

Thanks!

@mnapoli mnapoli merged commit 76dd4ad into myclabs:master Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants