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
Issue #2749287: Implement a Calculator class and use it in the Price value object #408
Conversation
Thanks! Do you mind filling out the docblocks? We need a description for each method, param, return value. |
@bojanz I've gone ahead and filled out the doc blocks. |
Fixed two docblocks with improper spacing. |
* This exception is thrown when attempting to perform math using two different currencies. | ||
* For example, adding a price in USD to another in EUR. | ||
*/ | ||
class CurrencyMismatchException extends \RuntimeException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bojanz should we have an Exception namespace for these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an easy change so let me know if this is something you'd like implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should. Follows the example of other Exception classes in Commerce.
* @param string $rate | ||
* A currency rate corresponding to the currency code. | ||
* | ||
* @return Price |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any object name given as a return or param hint must be fully qualified (have the full namespace).
@bojanz okay I applied your suggested changes. |
424752f
to
b5cc4b2
Compare
c89efa0
to
3944b06
Compare
Committed in 071d9ba after some bike shedding :) |
No description provided.