1 | <?php |
||
19 | class DeferredAdapter implements DeferredInterface |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * @var Deferred |
||
24 | */ |
||
25 | private $adaptee; |
||
26 | |||
27 | /** |
||
28 | * @var string fully qualified class name of the promise to create. |
||
29 | */ |
||
30 | private $promiseClass = PromiseAdapter::class; |
||
31 | |||
32 | /** |
||
33 | * DeferredAdapter constructor. |
||
34 | * |
||
35 | * @param \React\Promise\Deferred $adaptee |
||
36 | */ |
||
37 | public function __construct(Deferred $adaptee) |
||
41 | |||
42 | /** |
||
43 | * @param \React\Promise\Deferred $adaptee |
||
44 | */ |
||
45 | private function setAdaptee(Deferred $adaptee) |
||
49 | |||
50 | /** |
||
51 | * @return mixed |
||
52 | */ |
||
53 | public function getAdaptee() |
||
57 | |||
58 | /** |
||
59 | * @param string $promiseClass |
||
60 | */ |
||
61 | public function setPromiseClass($promiseClass) |
||
65 | |||
66 | /** |
||
67 | * @return string |
||
68 | */ |
||
69 | public function getPromiseClass() |
||
73 | |||
74 | /** |
||
75 | * @return PromiseInterface |
||
76 | */ |
||
77 | public function promise() |
||
81 | |||
82 | /** |
||
83 | * @param null $value |
||
84 | */ |
||
85 | public function resolve($value = null) |
||
89 | |||
90 | /** |
||
91 | * @param null $reason |
||
92 | */ |
||
93 | public function reject($reason = null) |
||
97 | |||
98 | /** |
||
99 | * @param null $update |
||
100 | */ |
||
101 | public function notify($update = null) |
||
105 | |||
106 | /** |
||
107 | * @return PromiseInterface |
||
108 | */ |
||
109 | private function createPromise() |
||
115 | |||
116 | } |