[PR #11734] Add processing binary binding type #13228

Open
opened 2026-01-22 16:16:35 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/11734

State: closed
Merged: No


Updated PR Description

Problem Statement

When using the findBy method in the repository with binary values as parameters, an unhandled error occurs: Unhandled match case 16.

How to reproduce:

$repository->findBy(['uuid' => ['<binary>']]);
Screenshot 2024-11-26 at 13 45 58

This error originates from the following code in the BasicEntityPersister class:
[BasicEntityPersister.php#L1930-L1941](https://github.com/doctrine/orm/blob/3.3.0/src/Persisters/Entity/BasicEntityPersister.php#L1930-L1941).

The current implementation does not handle ParameterType::BINARY properly, leading to unexpected behavior instead of throwing an appropriate exception or processing binary values.

Actual Behavior

  • For unsupported parameter types like ParameterType::BINARY, the code fails with Unhandled match case 16.
  • This error occurs instead of processing the value or raising an explicit, meaningful exception.
  • There is no way to handle this behavior externally due to the unprocessed case in the repository logic.

Expected Behavior

  • The system should either:
    1. Process binary values appropriately when passed to the findBy method.
    2. Throw a clear and descriptive exception for unsupported parameter types.
  • Ensure compatibility for scalar values (e.g., binary data) within the repository methods.

Changes Made in This PR

  • Updated the handling logic in the BasicEntityPersister class to process ParameterType::BINARY correctly.
  • Introduced proper exception handling for unsupported parameter types, providing more clarity on the issue to users.
  • Ensured backward compatibility for all currently supported parameter types.

Impact of Changes

  • Resolves the Unhandled match case 16 error for binary parameters.
  • Improves error messaging and developer experience when unsupported parameter types are used.
  • Enhances support for handling binary data in findBy methods.
**Original Pull Request:** https://github.com/doctrine/orm/pull/11734 **State:** closed **Merged:** No --- ### Updated PR Description #### Problem Statement When using the `findBy` method in the repository with binary values as parameters, an unhandled error occurs: `Unhandled match case 16`. **How to reproduce:** ```php $repository->findBy(['uuid' => ['<binary>']]); ``` <img width="1286" alt="Screenshot 2024-11-26 at 13 45 58" src="https://github.com/user-attachments/assets/92489c17-8f24-42e0-ac1b-c054513b8311"> This error originates from the following code in the `BasicEntityPersister` class: [[BasicEntityPersister.php#L1930-L1941](https://github.com/doctrine/orm/blob/3.3.0/src/Persisters/Entity/BasicEntityPersister.php#L1930-L1941)](https://github.com/doctrine/orm/blob/3.3.0/src/Persisters/Entity/BasicEntityPersister.php#L1930-L1941). The current implementation does not handle `ParameterType::BINARY` properly, leading to unexpected behavior instead of throwing an appropriate exception or processing binary values. #### Actual Behavior - For unsupported parameter types like `ParameterType::BINARY`, the code fails with `Unhandled match case 16`. - This error occurs instead of processing the value or raising an explicit, meaningful exception. - There is no way to handle this behavior externally due to the unprocessed case in the repository logic. #### Expected Behavior - The system should either: 1. Process binary values appropriately when passed to the `findBy` method. 2. Throw a clear and descriptive exception for unsupported parameter types. - Ensure compatibility for scalar values (e.g., binary data) within the repository methods. #### Changes Made in This PR - Updated the handling logic in the `BasicEntityPersister` class to process `ParameterType::BINARY` correctly. - Introduced proper exception handling for unsupported parameter types, providing more clarity on the issue to users. - Ensured backward compatibility for all currently supported parameter types. #### Impact of Changes - Resolves the `Unhandled match case 16` error for binary parameters. - Improves error messaging and developer experience when unsupported parameter types are used. - Enhances support for handling binary data in `findBy` methods.
admin added the pull-request label 2026-01-22 16:16:35 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#13228