Skip to content

Error: Value '24' is not part of the enum POData\Providers\Metadata\ResourcePropertyKind #279

@kirill533

Description

@kirill533

Hi Guys, came back to your library after my code started to break with the latest version of myclabs/php-enum package.

I though, it will be fixed in your version, but seems like it is the same issue here.

If you do the composer update to the latest version of myclabs/php-enum package, the tests should start giving errors. Most common error is like this:

68) UnitTests\POData\Providers\Metadata\ResourceTypeTest::testisResourceKindValidForPropertyKind with data set #16 (24, 2, false)
UnexpectedValueException: Value '24' is not part of the enum POData\Providers\Metadata\ResourcePropertyKind

The reason is that myclabs/php-enum package has now extra validation here: \MyCLabs\Enum\Enum::assertValidValueReturningKey

I guess it expects the class ResourcePropertyKind to have a constant with number 24 (KEY | PRIMITIVE). And actually, adding extra constants helps to fix the errors on my side.

My PHP version: PHP 7.3.19-1+ubuntu18.04.1+deb.sury.org+1

One solution would be to adjust composer.json to support only myclabs/php-enum with version below 1.8.0. But, please, make it compatible with myclabs/php-enum 1.8 and higher to make the library easier to combine with other libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions