BC : Type-hint of annotation construct of Doctrine\ORM\MappingManyToOne #6768

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

Originally created by @ohaag on GitHub (Jun 24, 2021).

Hello,

Isn't there a Breaking change introduced with this MR which have been missed ?
The highlighted line type-hint the cascade annotation into an array.
But it was previously possible to write cascade="all".
Now, it generated this error :
Argument 2 passed to Doctrine\ORM\Mapping\ManyToOne::__construct() must be of the type array or null, string given, called in /Users/ohaag/workspace/mist/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php on line 971

Only cascade={"all"} works.

This should be noticed in upgrade documentation.

N.B : it could have further impact as the construct have been added for many Class in the same time. I only tested the cascade issue.

Originally created by @ohaag on GitHub (Jun 24, 2021). Hello, Isn't there a Breaking change introduced with this [MR](https://github.com/doctrine/orm/pull/8266/files#diff-790d3cacd00cac9337da12d655fb50429091d836071bc62952c55561daae157aR63) which have been missed ? The highlighted line type-hint the cascade annotation into an array. But it was previously possible to write `cascade="all"`. Now, it generated this error : `Argument 2 passed to Doctrine\ORM\Mapping\ManyToOne::__construct() must be of the type array or null, string given, called in /Users/ohaag/workspace/mist/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php on line 971` Only `cascade={"all"}` works. This should be noticed in upgrade documentation. N.B : it could have further impact as the construct have been added for many Class in the same time. I only tested the cascade issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6768