Pipeline
class Pipeline implements Pipeline (View source)
Traits
Properties
protected Container|null | $container | The container implementation. |
|
protected mixed | $passable | The object being passed through the pipeline. |
|
protected array | $pipes | The array of class pipes. |
|
protected string | $method | The method to call on each pipe. |
Methods
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Create a new class instance.
Set the object being sent through the pipeline.
Set the array of pipes.
Push additional pipes onto the pipeline.
Set the method to call on the pipes.
Run the pipeline and return the result.
Parse full pipe string to get name and parameters.
Get the array of configured pipes.
Get the container instance.
Handle the value returned from each pipe before passing it to the next.
Details
$this|TWhenReturnType
when($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
$this|TUnlessReturnType
unless($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
void
__construct(Container|null $container = null)
Create a new class instance.
$this
send(mixed $passable)
Set the object being sent through the pipeline.
$this
through(array|mixed $pipes)
Set the array of pipes.
$this
pipe(array|mixed $pipes)
Push additional pipes onto the pipeline.
$this
via(string $method)
Set the method to call on the pipes.
mixed
then(Closure $destination)
Run the pipeline with a final destination callback.
mixed
thenReturn()
Run the pipeline and return the result.
protected Closure
prepareDestination(Closure $destination)
Get the final piece of the Closure onion.
protected Closure
carry()
Get a Closure that represents a slice of the application onion.
protected array
parsePipeString(string $pipe)
Parse full pipe string to get name and parameters.
protected array
pipes()
Get the array of configured pipes.
protected Container
getContainer()
Get the container instance.
$this
setContainer(Container $container)
Set the container instance.
protected mixed
handleCarry(mixed $carry)
Handle the value returned from each pipe before passing it to the next.
protected mixed
handleException(mixed $passable, Throwable $e)
Handle the given exception.