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

getArrayBindingType method from the BasicEntityPersister is missing binary #11479

Open
delolmo opened this issue May 28, 2024 · 1 comment
Open

Comments

@delolmo
Copy link

delolmo commented May 28, 2024

Bug Report

Q A
BC Break yes
Version 3.2.0

Summary

The getArrayBindingType method from the BasicEntityPersister is missing the binary type.

My guess is this:

        return match ($type) {
            ParameterType::STRING => ArrayParameterType::STRING,
            ParameterType::INTEGER => ArrayParameterType::INTEGER,
            ParameterType::ASCII => ArrayParameterType::ASCII,
        };

should be changed to this:

        return match ($type) {
            ParameterType::STRING => ArrayParameterType::STRING,
            ParameterType::INTEGER => ArrayParameterType::INTEGER,
            ParameterType::ASCII => ArrayParameterType::ASCII,
            ParameterType::BINARY => ArrayParameterType::BINARY,
        };

Need expert hands though to evaluate the problem.

Current behavior

Right now, when using binary fields, the following exception can be thrown under certain circumstances (I suspect it happens when retrieving entities with associations):

PHP Fatal error:  Uncaught UnhandledMatchError: Unhandled match case of type Doctrine\DBAL\ParameterType in (...)/vendor/doctrine/orm/src/Persisters/Entity/BasicEntityPersister.php:1911

How to reproduce

Not sure how to tbh.

Expected behavior

Should not throw an error.

@greg0ire
Copy link
Member

When opening the file with my IDE, I get this warning: Match expression does not handle remaining values: Doctrine\DBAL\ParameterType::BINARY|Doctrine\DBAL\ParameterType::BOOLEAN|Doctrine\DBAL\ParameterType::LARGE_OBJECT|Doctrine\DBAL\ParameterType::NULL. You might be on to something. Would be great to have a reproducer though. A stack trace might help as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants