mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #11414] Fix BIGINT validation #13007
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/11414
State: closed
Merged: Yes
Fixes #11377.
Our schema validation currently fails if we map a
BIGINTcolumn to a property with anintPHP type. While this is technically correct because DBAL 3 hydratesBIGINTvalues as strings, the error is also unnecessarily strict:The ORM will cast strings returned by DBAL back to
int, if that's the property type. The value range ofBIGINTand PHP's int (on 64bit machines) is the same. StoringBIGINTvalues as string is only necessary if we run on 32bit PHP or we deal withBIGINT UNSIGNEDon MySQL/MariaDB. Both are edge cases a project may validly choose to ignore.Emitting this error encourages downstream projects to change their property types of
BIGINTcolumns frominttostringwhich is unfortunate given that DBAL 4 moved towards returning integers if possible.