1 | <?php |
||
12 | trait LazyPromiseTrait |
||
13 | { |
||
14 | private $factory; |
||
15 | private $promise; |
||
16 | |||
17 | public function setFactory(callable $factory) |
||
21 | |||
22 | public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) |
||
26 | |||
27 | public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) |
||
31 | |||
32 | public function otherwise(callable $onRejected) |
||
36 | |||
37 | public function always(callable $onFulfilledOrRejected) |
||
41 | |||
42 | public function progress(callable $onProgress) |
||
46 | |||
47 | public function cancel() |
||
51 | |||
52 | private function promise() |
||
64 | } |
||
65 |
Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.