Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 649 Bytes

UPGRADE.md

File metadata and controls

39 lines (32 loc) · 649 Bytes

Upgrade guide

From 0.1.0 to 0.2.0

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;
     }
}