Replace deprated/removed GuzzleHttp\Psr7\build_query #500
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.
Description
This PR replaces the
Psr7\build_query()
calls withPsr7\Query::build()
.Psr7\build_query()
is deprecated in version1.x
ofguzzlehttp/psr7
and will be removed in2.0
.This also lead me to see that this project doesn't explicitely require guzzlehttp/psr7 as a dependency, but instead relies on guzzlehttp/guzzle to supply it, which is not safe to assume. Because methods of
guzzlehttp/psr7
are used in this package, you should explicitely requireguzzlehttp/psr7
as a dependency in this package.Guzzlehttp/guzzle changed their requirement of
guzzlehttp/psr7
to^1.7 || ^2.0
.After 2.0 will be stable, if you
composer require auth0/auth0-php
, it will break because auth0-php will require guzzlehttp/guzzle which in turn will install guzzlehttp/psr7 version 2, which will not have the build_query function that auth0-php uses.You can already see this behaviour by setting your composer minimum stability to dev.
To mitigate this, this PR also explicitely requires
guzzlehttp/psr7
1.x as a dependency in composer.json.References
psr7^2.0 added to guzzle: guzzle/guzzle@0103c78#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34
Testing
Any static analysis tool will tell you it doesn't use deprecated methods anymore.
Checklist
master