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

Extracted functions to static methods #113

Merged
merged 2 commits into from Sep 19, 2020
Merged

Extracted functions to static methods #113

merged 2 commits into from Sep 19, 2020

Conversation

GrahamCampbell
Copy link
Member

@GrahamCampbell GrahamCampbell commented Jun 27, 2020

This PR pairs with guzzle/guzzle#2712. After this is merged, we can tag 1.4.0.

TODO:

  • Extract all functions to static class methods
  • Deprecate all functions and point to their replacements
  • Replace all uses in src
  • Update the tests
  • Update documentation and examples
  • Update change log

Mappings:

Original Function Replacement Method
queue Utils::queue
task Utils::task
promise_for Create::promiseFor
rejection_for Create::rejectionFor
exception_for Create::exceptionFor
iter_for Create::iterFor
inspect Utils::inspect
inspect_all Utils::inspectAll
unwrap Utils::unwrap
all Utils::all
some Utils::some
any Utils::any
settle Utils::settle
each Each::of
each_limit Each::ofLimit
each_limit_all Each::ofLimitAll
!is_fulfilled Is::pending
is_fulfilled Is::fulfilled
is_rejected Is::rejected
is_settled Is::settled
coroutine Coroutine::of

NB The overall idea of these changes was approved by the original author, Michael: #108.

@GrahamCampbell GrahamCampbell marked this pull request as draft June 27, 2020 21:15
@GrahamCampbell GrahamCampbell marked this pull request as ready for review June 29, 2020 13:21
@GrahamCampbell
Copy link
Member Author

Friendly ping @Tobion and @Nyholm. It'd be good to have this merged so I can focus on PHP 8.0 support next, without conflicts.

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.

Thank you @GrahamCampbell for this.

I've reviewed it multiple times over the months and today I decided to be super picky and finish it all.

I found just one small thing that only "technically" could have a side effect. Good job!

src/Utils.php Outdated Show resolved Hide resolved
@Nyholm Nyholm merged commit 07e2de8 into guzzle:master Sep 19, 2020
@GrahamCampbell GrahamCampbell deleted the no-functions branch September 19, 2020 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants