Skip to content

Detect DBAL's number type #11781

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: 3.4.x
Choose a base branch
from
Open

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Jan 6, 2025

Leverages doctrine/dbal#6686.

@stof
Copy link
Member

stof commented Mar 24, 2025

How does BCMath\Number behaves regarding the change tracking in the ORM ? The discussion in DBAL says it should be compared with ==, and I don't think this is what the ORM does.

@derrabus
Copy link
Member Author

derrabus commented Apr 3, 2025

We kind of have the same problem here as we already do with DateTime objects. If you don't modify a property that stores a number, it's fine. But if you set that property to a new number object, it will be detected as changed even if the new number object is equal to the old one. But I don't think we need to solve this issue in this PR.

@@ -36,36 +39,38 @@ private static function chainTypedFieldMapper(): ChainTypedFieldMapper
/**
* Data Provider for NamingStrategy#classToTableName
*
* @return array<
* @return Generator<
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generator requires 4 template types in its generic signature. I suggest using iterable as type instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine. Generator<TKey, TValue> is widely understood by static analyzers.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants