aporat / store-receipt-validator

PHP receipt validator for Apple iTunes, Google Play and Amazon App Store
Apache License 2.0
633 stars 153 forks source link

Carbon Dependency error #169

Closed Orifiael closed 9 months ago

Orifiael commented 1 year ago

Newer versions for Carbon already patched this error, but since store-receipt-validator is hardlocked on a certain version this can still occur in certain user conditions.

While using the store-receipt-validator it would crash on Carbon\Carbon::setLastErrors(): Argument #1 ($lastErrors) must be of type array, bool given, called in /home/customer/www/bassemb5.sg-host.com/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php on line 98 if certain system preferences weren't properly set.

All that would be required is store-receipt-validator updating Carbon to the latest version.

Also see: https://stackoverflow.com/questions/74749564/laravel-carbon-carbonsetlasterrors/74960837

Stafox commented 1 year ago

Thanks

Stafox commented 1 year ago

Carbon version is not hardlocked.

See require section in composer.json

"nesbot/carbon":"^1.0|^2.0",

So you should be able to install any available version regarding your environment.