Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid "functions" from dependencies #2712

Merged
merged 2 commits into from Sep 30, 2020
Merged

Avoid "functions" from dependencies #2712

merged 2 commits into from Sep 30, 2020

Conversation

GrahamCampbell
Copy link
Member

@GrahamCampbell GrahamCampbell commented Jun 27, 2020

The aim of this PR is to avoid the use of functions provided by our dependencies. This means using their new Utils classes, and bumping their minimum versions (guzzlehttp/promises:^1.4; guzzlehttp/psr7:^1.7). Note that similar changes were already implemented for Guzzle 7.0 itself, but not its dependencies, which we are going to address now, for Guzzle 7.1.

TODO:

Mappings:

Original Function Replacement Method
GuzzleHttp\Promise\queue GuzzleHttp\Promise\Utils::queue
GuzzleHttp\Promise\task GuzzleHttp\Promise\Utils::task
GuzzleHttp\Promise\promise_for GuzzleHttp\Promise\Create::promiseFor
GuzzleHttp\Promise\rejection_for GuzzleHttp\Promise\Create::rejectionFor
GuzzleHttp\Promise\exception_for GuzzleHttp\Promise\Create::exceptionFor
GuzzleHttp\Promise\iter_for GuzzleHttp\Promise\Create::iterFor
GuzzleHttp\Promise\inspect GuzzleHttp\Promise\Utils::inspect
GuzzleHttp\Promise\inspect_all GuzzleHttp\Promise\Utils::inspectAll
GuzzleHttp\Promise\unwrap GuzzleHttp\Promise\Utils::unwrap
GuzzleHttp\Promise\all GuzzleHttp\Promise\Utils::all
GuzzleHttp\Promise\some GuzzleHttp\Promise\Utils::some
GuzzleHttp\Promise\any GuzzleHttp\Promise\Utils::any
GuzzleHttp\Promise\settle GuzzleHttp\Promise\Utils::settle
GuzzleHttp\Promise\each GuzzleHttp\Promise\Each::of
GuzzleHttp\Promise\each_limit GuzzleHttp\Promise\Each::ofLimit
GuzzleHttp\Promise\each_limit_all GuzzleHttp\Promise\Each::ofLimitAll
!GuzzleHttp\Promise\is_fulfilled GuzzleHttp\Promise\Is::pending
GuzzleHttp\Promise\is_fulfilled GuzzleHttp\Promise\Is::fulfilled
GuzzleHttp\Promise\is_rejected GuzzleHttp\Promise\Is::rejected
GuzzleHttp\Promise\is_settled GuzzleHttp\Promise\Is::settled
GuzzleHttp\Promise\coroutine GuzzleHttp\Promise\Coroutine::of
GuzzleHttp\Psr7\str GuzzleHttp\Psr7\Message::toString
GuzzleHttp\Psr7\uri_for GuzzleHttp\Psr7\Utils::uriFor
GuzzleHttp\Psr7\stream_for GuzzleHttp\Psr7\Utils::streamFor
GuzzleHttp\Psr7\parse_header GuzzleHttp\Psr7\Header::parse
GuzzleHttp\Psr7\normalize_header GuzzleHttp\Psr7\Header::normalize
GuzzleHttp\Psr7\modify_request GuzzleHttp\Psr7\Utils::modifyRequest
GuzzleHttp\Psr7\rewind_body GuzzleHttp\Psr7\Message::rewindBody
GuzzleHttp\Psr7\try_fopen GuzzleHttp\Psr7\Utils::tryFopen
GuzzleHttp\Psr7\copy_to_string GuzzleHttp\Psr7\Utils::copyToString
GuzzleHttp\Psr7\copy_to_stream GuzzleHttp\Psr7\Utils::copyToStream
GuzzleHttp\Psr7\hash GuzzleHttp\Psr7\Utils::hash
GuzzleHttp\Psr7\readline GuzzleHttp\Psr7\Utils::readLine
GuzzleHttp\Psr7\parse_request GuzzleHttp\Psr7\Message::parseRequest
GuzzleHttp\Psr7\parse_response GuzzleHttp\Psr7\Message::parseResponse
GuzzleHttp\Psr7\parse_query GuzzleHttp\Psr7\Query::parse
GuzzleHttp\Psr7\build_query GuzzleHttp\Psr7\Query::build
GuzzleHttp\Psr7\mimetype_from_filename GuzzleHttp\Psr7\MimeType::fromFilename
GuzzleHttp\Psr7\mimetype_from_extension GuzzleHttp\Psr7\MimeType::fromExtension
GuzzleHttp\Psr7\_parse_message GuzzleHttp\Psr7\Message::parseMessage
GuzzleHttp\Psr7\_parse_request_uri GuzzleHttp\Psr7\Message::parseRequestUri
GuzzleHttp\Psr7\get_message_body_summary GuzzleHttp\Psr7\Message::bodySummary
GuzzleHttp\Psr7\_caseless_remove GuzzleHttp\Psr7\Utils::caselessRemove

Closes #2740.

@GrahamCampbell GrahamCampbell marked this pull request as ready for review June 29, 2020 14:16
@GrahamCampbell GrahamCampbell reopened this Jul 1, 2020
@Nyholm Nyholm added this to the 7.2.0 milestone Sep 19, 2020
@GrahamCampbell GrahamCampbell changed the title [7.1] Avoid "functions" from dependencies Avoid "functions" from dependencies Sep 19, 2020
@GrahamCampbell GrahamCampbell mentioned this pull request Sep 19, 2020
Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these changes looks good.

Thank you.

@Nyholm
Copy link
Member

Nyholm commented Sep 30, 2020

The Promises package and the PSR7 package is now tagged.

@GrahamCampbell GrahamCampbell marked this pull request as ready for review September 30, 2020 09:33
Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work.

Thank you

BrandonSurowiec added a commit to BrandonSurowiec/salesforce-laravel-oauth2-rest that referenced this pull request Sep 23, 2023
Replace with the new `GuzzleHttp\Psr7\Utils::` static methods:
guzzle/guzzle#2712
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/keep-open Issues that should not be closed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal error: Call to undefined function GuzzleHttp\Psr7\uri_for() in guzzlehttp/guzzle/src/Client.php:63
2 participants