Methods |
public
|
after(Closure(TInput $payload, static $pipeline, TArgument $arg): (TInput|TOutput) $closure): static
Apply a closure to each payload before it is sent
Apply a closure to each payload before it is sent
This method can only be called once per pipeline.
Implemented by
|
#
|
public
|
afterIf(Closure(TInput $payload, static $pipeline, TArgument $arg): (TInput|TOutput) $closure): static
Apply a closure to each payload before it is sent if after() hasn't
already been called
Apply a closure to each payload before it is sent if after() hasn't
already been called
Implemented by
|
#
|
public
|
through(
(Closure(TInput $payload, Closure $next, static $pipeline, TArgument $arg): (TInput|TOutput))|(Closure(TOutput $payload, Closure $next, static $pipeline, TArgument $arg): TOutput)|PipeInterface<TInput, TOutput, TArgument>|class-string<PipeInterface<TInput, TOutput, TArgument>> $pipe,
): static
Add a pipe to the pipeline
Add a pipe to the pipeline
A pipe must be one of the following:
- an instance of a class that implements {@see PipeInterface}
- the name of a class that implements {@see PipeInterface}
- a closure
Whichever form it takes, a pipe should do something with $payload
before taking one of the following actions:
- return the value of
$next($payload)
- return a value that will be discarded by
{@see StreamPipelineInterface::unless()}, bypassing any remaining pipes
and {@see BasePipelineInterface::then()}, if applicable
- throw an exception
Implemented by
|
#
|
public
|
throughClosure(
(Closure(TInput $payload, static $pipeline, TArgument $arg): (TInput|TOutput))|(Closure(TOutput $payload, static $pipeline, TArgument $arg): TOutput) $closure,
): static
Add a simple closure to the pipeline
Add a simple closure to the pipeline
Implemented by
|
#
|
public
|
throughKeyMap(
array<array-key, array-key|array-key[]> $keyMap,
int-mask-of<ArrayMapperInterface::*> $flags = ArrayMapperInterface::ADD_UNMAPPED,
): static
Add an array key mapper to the pipeline
Add an array key mapper to the pipeline
Parameters
$keyMap |
An array that maps
input keys to one or more output keys.
|
Implemented by
|
#
|
public
|
then(
(Closure(TInput $result, static $pipeline, TArgument $arg): TOutput)|(Closure(TOutput $result, static $pipeline, TArgument $arg): TOutput) $closure,
): static
Apply a closure to each result
Apply a closure to each result
This method can only be called once per pipeline, and only if
{@see StreamPipelineInterface::collectThen()} is not also called.
Implemented by
|
#
|
public
|
thenIf(
(Closure(TInput $result, static $pipeline, TArgument $arg): TOutput)|(Closure(TOutput $result, static $pipeline, TArgument $arg): TOutput) $closure,
): static
Apply a closure to each result if then() hasn't already been called
Apply a closure to each result if then() hasn't already been called
Implemented by
|
#
|
public
|
cc(Closure(TOutput $result, static $pipeline, TArgument $arg): mixed $closure): static
Pass each result to a closure
Pass each result to a closure
Results not discarded by {@see StreamPipelineInterface::unless()} are
passed to the closure before leaving the pipeline. The closure's return
value is ignored.
Implemented by
|
#
|