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

Also bind the full class name in the service provider, not only the facade #10

Closed webcraft closed 8 years ago

webcraft commented 8 years ago

I noticed a small glitch when using the Controller class, which comes in play when using the frontend integration.

A VatCalculator instance is injected in the constructor of this class. But when the container resolves this class, it doesn't use the binding defined in the service provider (registerVatCalculator()), as this only binds the facade, not the main class. For the main class, the container will just use basic reflection, which is ok most of the times, but it means the $config parameter is not set.

This results in not having the config set in this controller, and ultimately the frontend integration ignoring your custom config (e.g. the business_country_code).

This PR makes sure the \Mpociot\VatCalculator\VatCalculator class is also bound. Thank you for your feedback and/or merging!

mpociot commented 8 years ago

Thank you for the PR!

I also removed the failing test, because it wasn't really testing anything (besides spell checking).