gnikyt / Basic-Shopify-API

A simple API wrapper for Shopify using Guzzle for REST and GraphQL
MIT License
220 stars 66 forks source link

Fix error in REST Rate Limiting #123

Closed roberttolton closed 3 years ago

roberttolton commented 3 years ago

To fix #121

I'm not sure how this came to be an error, considering these lines pushing arrays, and not floats, into the array of times that gets cached:

https://github.com/osiset/Basic-Shopify-API/blob/a83e66891511535ea338e67281892d6e8289a320/src/Middleware/UpdateApiLimits.php#L106:L111

But, this PR checks to see if the item being used from the array is an array, before trying to access it's time key.

If I've missed something obvious, please let me know.

roberttolton commented 3 years ago

Updated PR