Fatal Error: Declaration of GuzzleHttp\Psr7\Uri::getScheme() must be…
-
Hello
This is possibly related to: https://github.com/bporcelli/simplesalestax/issues/139
We started using TaxCloud + Simple Sales Tax recently. Initially, it seemed fine, but in the last few days we’ve started to get this error – perhaps an update elsewhere.
My understanding of the issue is that SST includes Guzzle version 6, but somewhere in my codebase exists Guzzle version 7. In both instances, the namespace is likely the same: GuzzleHttp\\etc and various conflicts are happening.
I’ve seen similar syntax-only issues with other plugins where there is a conflict between dependencies simply because a return type wasn’t specified on a method, even if the body of the method is no different between versions.
We’ve worked around it by essentially making our own plugin comprised of Simple Sales Tax and a manually-included phptaxcloud library, but with Guzzle’s version set to > v7 in it’s composer.json. This seems to work fine – but of course we’re now maintaining a custom plugin which isn’t ideal.
Is there a plan to update the Guzzle dep to v7+? I can see your repo for phptaxcloud it is deprecated in favor of official SDKs but from what I can see they use the older version of Guzzle too!
One idea that I also wanted to propose – though I’ve not tested with your plugin – is to use https://github.com/coenjacobs/mozart
It scopes the namespace of your Composer dependencies (which in a perfect world all WP plugins would have to abide by!); the idea being the bundled version of Guzzle would no longer have a namespace of GuzzleHttp but instead SimpleSalesTax\\GuzzleHttp.
Thanks
- The topic ‘Fatal Error: Declaration of GuzzleHttp\Psr7\Uri::getScheme() must be…’ is closed to new replies.