chainCallables.php
Table of Contents
Functions
- chainCallables() : callable|null
- Chains multiple callables to be executed in sequence.
Functions
chainCallables()
Chains multiple callables to be executed in sequence.
chainCallables([array<string|int, mixed> $callables = [] ]) : callable|null
Creates a pipeline where each callable's output becomes the next callable's input. The first callable receives the arguments passed to the chain; subsequent callables receive only the result from the previous callable.
Returns null if the array is empty or if any callable cannot be resolved. Execution stops at the first unresolvable callable in the chain.
Parameters
- $callables : array<string|int, mixed> = []
-
An array of callables to execute in sequence. Each can be a string, array, object, or Closure.
Tags
Return values
callable|null —A new callable that executes the chain, or null if invalid