Update the default options to handle a null resize #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By leaving the resize option in the data object as an empty array, the API responds with an error message. To fix this, the code is now detecting if the resize option was passed in... if it was not, it simply removes resize from the json ecoded string.
Next, I updated your error messages to include 'response'. This will allow much easier debugging instead of simply returning "Unknown error"
I updated the spacing and code style to match the code style standards that all popular php frameworks, like Laravel and Symphony, use.
Finally, I modified the use of array() to leverage the [] brackets instead. Bracket array support was added with php version 5.4, which was released in 2013.
If any of these updates are unwelcomed, let me know and I'll happily make the updates. Fixing this issue in this repo and updating composer will simplify support for myself and everyone else using this..