driesvints / vat-calculator

Handle all the hard stuff related to EU MOSS tax/vat regulations, the way it should be.
MIT License
1.2k stars 88 forks source link

Refactoring suggestion #159

Closed AhmedRezk59 closed 1 year ago

AhmedRezk59 commented 1 year ago

Hi

In VatCalculator.php, There are three variables :

And every one of those variables has information about each country. The problem is that i think that this violates the SRP and OCP principles. Shouldn't we separate each country in its own class and use the Service Container to inject those variables based on the parameters passed? I think that is going to improve the design greatly. If that is ok and you accept this suggestion, I can start working on it.

Thanks!

driesvints commented 1 year ago

Hi there. Right now I have no plans to change anything here myself. If you want, you can send in a PR and depending on the complexity we can maybe merge it in. Thanks.