laravel-xero
laravel-xero copied to clipboard
Correct class inheritance for easier mockery usage
I believe your resource classes should extend the actual implementations, and not the facades - they are not themselves facades. To make this work you then have to call instance methods instead of calling back to the facade.
The original way makes phpstan upset in some situations, and mockery is unable to mock the objects using demeter chains due to all of the calls within each resource that then go back round through the facade.
Tests still pass etc, seems functionally equivalent - just more correct ? But perhaps that is subjective...
Also added the docblocks to make phpstan happy(er).