Skip to content

Fix build with ORM 3.7 and DBAL 4.5 - #803

Merged
ondrejmirtes merged 1 commit into
2.1.xfrom
fix-orm-3.7-dbal-4.5
Oct 26, 2026
Merged

ondrejmirtes merged 1 commit into
2.1.xfrom
fix-orm-3.7-dbal-4.5

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

The ORM 3 / DBAL 4 matrix entries (Tests and PHPStan on PHP 8.3) have been failing on 2.1.x since early October, after doctrine/orm 3.7 and doctrine/dbal 4.5.

Tests (79 failures/errors → 0):

  • Id.patch: ORM 3.7 added a $position constructor argument to Mapping\Id. Without @NamedArgumentConstructor, doctrine/annotations passes the values array to it, so loading any entity with @ORM\Id failed.
  • JoinColumns.patch, OrderBy.patch: regenerated against ORM 3.7, whose sources no longer matched the patch context (composer-patches skipped them).

PHPStan:

  • stubs/DBAL/Connection4.stub: dropped the native int|string return types of delete()/update()/insert(). PHPStan now reports native union types in stubs below PHP 8.0; stubs only contribute PHPDoc types, and the @return int|numeric-string stays, as with the other methods in the stub.
  • Baselined the TypedExpression (deprecated in ORM 3.7) and SimpleArrayType (deprecated in DBAL 4.5) usages, like the existing ArrayType/ObjectType entries. Built-in ORM functions still implement TypedExpression alongside the new ExpressionWithReturnType, so inference is unchanged.

Verified locally with ORM 3.7.5 / DBAL 4.5.0 (patched, as in CI) and with the default ORM 2.20 / DBAL 3.10: phpunit and make phpstan pass on both.

- Id.patch: ORM 3.7 added a $position constructor argument to the Id
  attribute, so the annotation needs @NamedArgumentConstructor; without
  it doctrine/annotations passes the values array and metadata loading
  fails.
- JoinColumns.patch, OrderBy.patch: regenerated against ORM 3.7, where
  the context no longer matched and the patches were skipped.
- Connection4.stub: drop native int|string return types from
  delete/update/insert (stubs only contribute PHPDoc types, and PHPStan
  now reports native union types in stubs below PHP 8.0), matching the
  other methods in the stub.
- Baseline the new TypedExpression (ORM 3.7) and SimpleArrayType
  (DBAL 4.5) deprecations; the extension still has to support both.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1779c-dd63-755f-9138-1668c7bb8eb3
@ondrejmirtes
ondrejmirtes merged commit 3729ef0 into 2.1.x Oct 26, 2026
51 checks passed
@ondrejmirtes
ondrejmirtes deleted the fix-orm-3.7-dbal-4.5 branch October 26, 2026 10:37
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

Successfully merging this pull request may close these issues.

1 participant