1 | <?php |
||
19 | class PromiseDeferred extends AbstractPromise implements DeferredInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var DeferredInterface[] |
||
23 | */ |
||
24 | private $deferreds = array(); |
||
25 | |||
26 | /** |
||
27 | * @var PromiseInterface |
||
28 | */ |
||
29 | private $actual = null; |
||
30 | |||
31 | /** |
||
32 | * @param callable $onFulfilled |
||
33 | * @param callable $onRejected |
||
34 | * @param callable $onNotify |
||
35 | * |
||
36 | * @return PromiseInterface |
||
37 | */ |
||
38 | public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onNotify = null) |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | public function resolve($value = null) |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function reject($reason = null) |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public function notify($state = null) |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | public function state() |
||
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | public function promise() |
||
92 | |||
93 | /** |
||
94 | * @param mixed $result |
||
95 | * @param bool $success |
||
96 | * |
||
97 | * @throws \LogicException |
||
98 | */ |
||
99 | private function changeState($result, $success) |
||
119 | |||
120 | /** |
||
121 | * @param callable $onFulfilled |
||
122 | * @param callable $onRejected |
||
123 | * @param callable $onNotify |
||
124 | * |
||
125 | * @return \Cubiche\Core\Async\Promise\DeferredProxy |
||
126 | */ |
||
127 | private function enqueue(callable $onFulfilled = null, callable $onRejected = null, callable $onNotify = null) |
||
134 | } |
||
135 |