invoiceninja / sdk-php

PHP wrapper for Invoice Ninja's REST API
https://www.invoiceninja.com
83 stars 41 forks source link

Unnecessary response code check #77

Closed minorOffense closed 2 years ago

minorOffense commented 2 years ago

Guzzle will automatically throw an exception if it doesn't get a success response. You shouldn't have to check for a 200.

Also there are other valid response codes (like 201 CREATED) that this current implementation wouldn't work with.

If all you're interested in is if the request was successful and not checking for specific types of success responses you should be able to skip the check all together.

https://github.com/invoiceninja/sdk-php/blob/7a644a50be2b5d24863cc03b01cdf84f62011d6d/src/InvoiceNinja.php#L198

turbo124 commented 2 years ago

78