Skip to content
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

EnumMap implements Serializable but it's not serializable #91

Closed
marc-mabe opened this issue Sep 19, 2017 · 0 comments · Fixed by #92
Closed

EnumMap implements Serializable but it's not serializable #91

marc-mabe opened this issue Sep 19, 2017 · 0 comments · Fixed by #92
Assignees
Labels
Milestone

Comments

@marc-mabe
Copy link
Owner

Currently the EnumMap is based on SplObjectStorage.
For whatever reason SplObjectStorage implements Serializable but the enumerator objects are not serializable (by default).

    public function testEnumMapSerializable()
    {
        $enumMap = new EnumMap(EnumBasic::class);
        $this->assertTrue($enumMap instanceof Serializable);

        $enumMap->offsetSet(EnumBasic::ONE, 'one');
        serialize($enumMap);
    }

// -> LogicException: Enums are not serializable
@marc-mabe marc-mabe added the bug label Sep 19, 2017
@marc-mabe marc-mabe added this to the 3.0.0 milestone Sep 19, 2017
@marc-mabe marc-mabe self-assigned this Sep 19, 2017
@marc-mabe marc-mabe changed the title EnumMap implements Serializable bit it's not serializable EnumMap implements Serializable but it's not serializable Sep 19, 2017
marc-mabe added a commit that referenced this issue Sep 28, 2017
marc-mabe added a commit that referenced this issue Oct 3, 2017
marc-mabe added a commit that referenced this issue Oct 17, 2017
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 a pull request may close this issue.

1 participant