| 1 | <?php  | 
            ||
| 15 | class Deferred implements DeferredInterface  | 
            ||
| 16 | { | 
            ||
| 17 | /**  | 
            ||
| 18 | * @var ProcessInterface  | 
            ||
| 19 | */  | 
            ||
| 20 | private $process;  | 
            ||
| 21 | |||
| 22 | /**  | 
            ||
| 23 | * @var \Closure[]  | 
            ||
| 24 | */  | 
            ||
| 25 | private $then = [];  | 
            ||
| 26 | |||
| 27 | /**  | 
            ||
| 28 | * Deferred constructor.  | 
            ||
| 29 | * @param ProcessInterface $process  | 
            ||
| 30 | * @param \Closure $then  | 
            ||
| 31 | */  | 
            ||
| 32 | public function __construct(ProcessInterface $process, \Closure $then)  | 
            ||
| 37 | |||
| 38 | /**  | 
            ||
| 39 | * @param callable $then  | 
            ||
| 40 | * @return DeferredInterface  | 
            ||
| 41 | */  | 
            ||
| 42 | public function then(callable $then): DeferredInterface  | 
            ||
| 48 | |||
| 49 | /**  | 
            ||
| 50 | * @param mixed ...$args  | 
            ||
| 51 | * @return mixed  | 
            ||
| 52 | */  | 
            ||
| 53 | public function __invoke(...$args)  | 
            ||
| 57 | |||
| 58 | /**  | 
            ||
| 59 | * @param mixed $value  | 
            ||
| 60 | * @return mixed  | 
            ||
| 61 | */  | 
            ||
| 62 | public function invoke($value)  | 
            ||
| 70 | }  | 
            ||
| 71 |