| 1 | <?php |
||
| 11 | class Deferred implements PromisorInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var Promise |
||
| 15 | */ |
||
| 16 | private $promise; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var callable |
||
| 20 | */ |
||
| 21 | private $resolveCallback; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var callable |
||
| 25 | */ |
||
| 26 | private $rejectCallback; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var callable |
||
| 30 | */ |
||
| 31 | private $notifyCallback; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var callable |
||
| 35 | */ |
||
| 36 | private $canceller; |
||
| 37 | |||
| 38 | 242 | public function __construct(callable $canceller = null) |
|
| 42 | |||
| 43 | 242 | public function promise() : PromiseInterface |
|
| 55 | |||
| 56 | 100 | public function resolve($value = null) |
|
| 62 | |||
| 63 | 94 | public function reject($reason = null) |
|
| 69 | |||
| 70 | 29 | public function notify($update = null) |
|
| 76 | } |
||
| 77 |