Skip to content

Extracted functions to static methods#113

Merged
Nyholm merged 2 commits intoguzzle:masterfrom
GrahamCampbell:no-functions
Sep 19, 2020
Merged

Extracted functions to static methods#113
Nyholm merged 2 commits intoguzzle:masterfrom
GrahamCampbell:no-functions

Conversation

@GrahamCampbell
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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!

@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.

2 participants