[PR #12254] [MERGED] fix: handling of empty array in SQL condition generation #13626

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

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/12254
Author: @elliotbruneel
Created: 10/30/2025
Status: Merged
Merged: 11/10/2025
Merged by: @greg0ire

Base: 2.20.xHead: fix/empty-array-query


📝 Commits (5)

  • b24586b fix: handling of empty array in SQL condition generation
  • 23f2286 chore: update phpstan version and regenerate baseline
  • 32d1e97 chore: improve empty array check in SQL condition generation
  • 4989ca6 test: add test for finding by nullable field with empty array
  • 9ef0f53 fix: update SQL condition for empty array to 1=0 instead of IN (NULL)

📊 Changes

5 files changed (+84 additions, -27 deletions)

View changed files

📝 composer.json (+1 -1)
📝 phpstan-baseline.neon (+7 -25)
📝 src/Persisters/Entity/BasicEntityPersister.php (+5 -0)
tests/Tests/ORM/Functional/Ticket/GH12254Test.php (+62 -0)
📝 tests/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php (+9 -1)

📄 Description

Fix a regression introduced in #12190: $repository->findBy(['uuid' => []] should be a valid expression and return an empty result.

Fixes #12245, with additional discussion at https://github.com/doctrine/orm/pull/12190#issuecomment-3455298734.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/12254 **Author:** [@elliotbruneel](https://github.com/elliotbruneel) **Created:** 10/30/2025 **Status:** ✅ Merged **Merged:** 11/10/2025 **Merged by:** [@greg0ire](https://github.com/greg0ire) **Base:** `2.20.x` ← **Head:** `fix/empty-array-query` --- ### 📝 Commits (5) - [`b24586b`](https://github.com/doctrine/orm/commit/b24586b1b53d141169a3be381eb64515b5adff65) fix: handling of empty array in SQL condition generation - [`23f2286`](https://github.com/doctrine/orm/commit/23f22860f1a5415d6a5465a3070464083abfedee) chore: update phpstan version and regenerate baseline - [`32d1e97`](https://github.com/doctrine/orm/commit/32d1e97ce7b0be4c9b24f9df39b7bd8da3d03258) chore: improve empty array check in SQL condition generation - [`4989ca6`](https://github.com/doctrine/orm/commit/4989ca6f1566b6929cc81b4b746b64ec889e0174) test: add test for finding by nullable field with empty array - [`9ef0f53`](https://github.com/doctrine/orm/commit/9ef0f5301b2176d093a6289961414db26c993282) fix: update SQL condition for empty array to 1=0 instead of IN (NULL) ### 📊 Changes **5 files changed** (+84 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `composer.json` (+1 -1) 📝 `phpstan-baseline.neon` (+7 -25) 📝 `src/Persisters/Entity/BasicEntityPersister.php` (+5 -0) ➕ `tests/Tests/ORM/Functional/Ticket/GH12254Test.php` (+62 -0) 📝 `tests/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php` (+9 -1) </details> ### 📄 Description Fix a regression introduced in #12190: `$repository->findBy(['uuid' => []]` should be a valid expression and return an empty result. Fixes #12245, with additional discussion at https://github.com/doctrine/orm/pull/12190#issuecomment-3455298734. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 16:17:49 +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#13626