Pipeline
class Pipeline extends Pipeline
Traits
Properties
| static protected array | $macros | The registered string macros. |
from Macroable |
| protected Container|null | $container | The container implementation. |
from Pipeline |
| protected mixed | $passable | The object being passed through the pipeline. |
from Pipeline |
| protected array | $pipes | The array of class pipes. |
from Pipeline |
| protected string | $method | The method to call on each pipe. |
from Pipeline |
| protected Closure|null | $finally | The final callback to be executed after the pipeline ends regardless of the outcome. |
from Pipeline |
| protected string|UnitEnum|false|null | $withinTransaction | Indicates whether to wrap the pipeline in a database transaction. |
from Pipeline |
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.
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Set a final callback to be executed after the pipeline ends regardless of the outcome.
Parse full pipe string to get name and parameters.
Execute each pipeline step within a database transaction.
Handle the value returned from each pipe before passing it to the next.
Details
in
Conditionable at line 23
mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
in
Conditionable at line 56
mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
in
Macroable at line 28
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 41
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 57
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 68
static void
flushMacros()
Flush the existing macros.
Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 78
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
in
Macroable at line 103
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
in
Pipeline at line 62
Pipeline
send(mixed $passable)
Set the object being sent through the pipeline.
in
Pipeline at line 102
mixed
then(Closure $destination)
Run the pipeline with a final destination callback.
in
Pipeline at line 124
mixed
thenReturn()
Run the pipeline and return the result.
in
Pipeline at line 134
Pipeline
finally(Closure $callback)
Set a final callback to be executed after the pipeline ends regardless of the outcome.
at line 21
protected Closure
prepareDestination(Closure $destination)
Get the final piece of the Closure onion.
Uses a static closure to avoid capturing $this, which would create a circular reference: Pipeline→passable→ProceedingJoinPoint→pipe→ destination closure→$this→Pipeline. The parent's version captures $this for handleException(), but AOP doesn't need exception-to-response conversion — exceptions propagate naturally through the aspect chain.
at line 31
protected Closure
carry()
Get the Closure that represents an AOP pipeline slice.
in
Pipeline at line 200
protected array
parsePipeString(string $pipe)
Parse full pipe string to get name and parameters.
in
Pipeline at line 216
protected array
pipes()
Get the array of configured pipes.
in
Pipeline at line 224
Pipeline
withinTransaction(string|UnitEnum|false|null $withinTransaction = null)
Execute each pipeline step within a database transaction.
in
Pipeline at line 256
protected mixed
handleCarry(mixed $carry)
Handle the value returned from each pipe before passing it to the next.
in
Pipeline at line 266
protected mixed
handleException(mixed $passable, Throwable $e)
Handle the given exception.
in
Pipeline at line 274
static void
flushState()
Flush all static state.