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

[9.x] Add ability to push additional pipes onto a pipeline via chain($pipes) #41256

Merged
merged 5 commits into from
Feb 28, 2022
Merged

[9.x] Add ability to push additional pipes onto a pipeline via chain($pipes) #41256

merged 5 commits into from
Feb 28, 2022

Conversation

stevebauman
Copy link
Contributor

@stevebauman stevebauman commented Feb 25, 2022

Description

This PR adds the ability to push additional pipes onto a pipeline via a chain() method.

This allows us to create a pipeline instance and pass it around the application, appending pipes onto the chain, rather than having to define all of the pipes in a single place:

$pipeline = new Pipeline();

$pipeline->chain(fn ($object, $next) => $next($object));
$pipeline->chain(fn ($object, $next) => $next($object));

$pipeline->send($object)->thenReturn();

Let me know if you would like anything adjusted. Thanks for your time! ❤️

@taylorotwell
Copy link
Member

Any thoughts on naming this method pipe instead of chain?

@stevebauman
Copy link
Contributor Author

Yea, I'm cool with that name 👍

@taylorotwell taylorotwell merged commit 219e0ea into laravel:9.x Feb 28, 2022
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