Callables don't have to be wrapped anymore.
// BEFORE
$pipeline->pipe(CallableStage::forCallable(function ($payload) {
return $payload;
}))->process($payload);
// After
$pipeline->pipe(function ($payload) {
return $payload;
})->process($payload);
Class based stages now require to implement the __invoke
method.
// BEFORE
class MyStage implements StageInterface
{
public function process($payload)
{
return $payload;
}
}
// AFTER
class MyStage implements StageInterface
{
public function __invoke($payload)
{
return $payload;
}
}