akaunting / laravel-money

Currency formatting and conversion package for Laravel
https://akaunting.com
MIT License
732 stars 101 forks source link

new self() vs new static() #29

Closed eric-reichenbach closed 5 years ago

eric-reichenbach commented 5 years ago

I'm not sure if it's a bug or a feature but the calculation functions return a new instance of self().

Returning a new static() would allow better inheritance behaviours (getting an new object of the current class instead of an instance of the base Money class).

denisdulici commented 5 years ago

Not really a feature. Would you mind to send a PR?

eric-reichenbach commented 5 years ago

Cool, I've submitted a PR. 👍