MockingMagician / coinbase-pro-sdk

Coinbase Pro API SDK - Communicate easily with the Coinbase Pro API in PHP
https://mockingmagician.github.io/coinbase-pro-sdk/
MIT License
22 stars 8 forks source link

Use native `Exception` in `ApiError` #22

Closed rogerthomas84 closed 3 years ago

rogerthomas84 commented 3 years ago

Little description of PR

The use of PHPUnit\Framework\Exception in the ApiError causes the request to fail if you've run composer install --no-dev -o

Requirements

Describe more the PR if needed

For example in the case of an order that you've cancelled inside the Coinbase app and you try to retrieve it using this SDK it'll throw an ApiError which will cause a fatal error if you've installed dependencies using --no-dev as the PHPUnit dependency is not installed.

Error:

PHP Fatal error:  Uncaught Error: Class 'PHPUnit\Framework\Exception' not found in /path/to/code/vendor/mocking-magician/coinbase-pro-sdk/src/Functional/Error/ApiError.php:14
MockingMagician commented 3 years ago

Very well spotted! It was an import error with the autocomplete of my IDE... Technology is nothing without humans :smile:

Thanks @rogerthomas84

rogerthomas84 commented 3 years ago

@MockingMagician no worries at all. I'm using this daily so I'm sure there will be some more coming soon. Fantastic library. Really great!