Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add Decimal128 type #2128

Merged
merged 4 commits into from May 6, 2020
Merged

Add Decimal128 type #2128

merged 4 commits into from May 6, 2020

Conversation

malarzm
Copy link
Member

@malarzm malarzm commented Nov 29, 2019

Q A
Type feature
BC Break no
Fixed issues #1835

Summary

As per title, again ;)

@malarzm malarzm added this to the 2.1.0 milestone Nov 29, 2019
@malarzm malarzm added this to In progress in ODM 2.1 via automation Nov 29, 2019
@malarzm
Copy link
Member Author

malarzm commented Dec 2, 2019

Please ignore CS issues for now, there's something fishy going on with my local instance of phpcbf. Also 3d6ac96 is a good candidate for a PR on its own and can be extracted as such. Other than that we have a working increment support for decimals (and user-land types) :)

Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

IMO, mapping should ensure that whenever a field is mapped with the Decimal128 type, it requires the ext-bcmath extension to be present. Otherwise, the code will terminate with a fatal error later down the line.

docs/en/reference/basic-mapping.rst Outdated Show resolved Hide resolved
lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php Outdated Show resolved Hide resolved
ODM 2.1 automation moved this from In progress to Review in progress Dec 5, 2019
@malarzm malarzm force-pushed the decimal128-type branch 7 times, most recently from f011128 to 88a57bd Compare December 15, 2019 14:26
@malarzm malarzm requested a review from alcaeus December 15, 2019 14:45
Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

Just a couple of minor things, rest LGTM 👍

Can you create an issue to track the interface for version types? (see #2128 (comment))

lib/Doctrine/ODM/MongoDB/LockException.php Outdated Show resolved Hide resolved
private function typeRequirementsAreMet(string $type) : void
{
if ($type === Type::DECIMAL128 && ! extension_loaded('bcmath')) {
throw MappingException::typeRequirementsNotFulfilled(Type::DECIMAL128, 'ext-bcmath is missing');
Copy link
Member

Choose a reason for hiding this comment

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

Adding the field and class names to the exception message will make it easier for users to spot which piece of their code is causing these errors.

ODM 2.1 automation moved this from Review in progress to Reviewer approved May 6, 2020
@alcaeus alcaeus merged commit efdde4c into doctrine:master May 6, 2020
ODM 2.1 automation moved this from Reviewer approved to Done May 6, 2020
@alcaeus
Copy link
Member

alcaeus commented May 6, 2020

Thanks Maciej!

@alcaeus alcaeus mentioned this pull request May 6, 2020
@malarzm malarzm mentioned this pull request May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
ODM 2.1
  
Done
Roadmap
2.1 (unsupported)
Development

Successfully merging this pull request may close these issues.

None yet

2 participants