gnikyt / Basic-Shopify-API

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

v10.0.6 throws errors in PHP 7.4 #135

Open jsirish opened 2 years ago

jsirish commented 2 years ago

We've been using this module for our Shopify module for some time and it's been great for us.

It appears the return type work in #129 may have caused issues in PHP 7.4. The graph command throws the following:

ERROR [Emergency]: Uncaught TypeError: Return value of Osiset\BasicShopifyAPI\ResponseAccess::offsetGet() must be an instance of Osiset\BasicShopifyAPI\mixed, instance of Osiset\BasicShopifyAPI\ResponseAccess returned
IN GET dev/tasks/ShopifyImportTask
Line 67 in /Users/xxx/Sites/silverstripe-shopify/vendor/osiset/basic-shopify-api/src/ResponseAccess.php

Using v10.0.5 with PHP 7.4 works as expected. v10.0.6 with PHP 7.4 throws the error above. PHP 8.0 with v10.0.6 works as expected.

squatto commented 2 years ago

This is happening because mixed was introduced in PHP 8.0, but v10.0.6 of this package has the PHP version requirement as >=7.3.0:

https://github.com/osiset/Basic-Shopify-API/blob/48497d512ae9e457635fb9f9d5859cb7339e38b1/composer.json#L24

fourstacks commented 2 years ago

This is related to issue #136.