Sequence
class Sequence extends Mutator (View source)
Combine multiple mutators into one. The output of the first mutator is passed to the second mutator, and so on.
Allowed mutators:
- Any mutator implementing the Mutator interface
- Any non-string callable
- Any array of mutators
Traits
Methods
__construct(array $sequence = [])
No description
mixed
mutate(mixed $value)
Mutate the input value.
Details
__construct(array $sequence = [])
No description
static Sequence
make(array $sequence = [])
No description
mixed
mutate(mixed $value)
Mutate the input value.
protected MutatorInterface
resolveMutator(mixed $mutator)
No description
protected array
resolveMutators(array $mutators)
No description
Sequence
then(callable ...$sequence)
Add mutator(s) to the sequence.
Sequence
when(callable|bool $condition, callable|array $then, callable|array $otherwise = null)
Add mutator(s) to the sequence that runs if a condition is met.