1 | <?php |
||
2 | /** |
||
3 | * Fusion |
||
4 | * User: moyo |
||
5 | * Date: 2018/4/3 |
||
6 | * Time: 10:32 PM |
||
7 | */ |
||
8 | |||
9 | namespace Carno\Promise\Features; |
||
10 | |||
11 | use Carno\Promise\Promised; |
||
12 | use Throwable; |
||
13 | |||
14 | trait Fusion |
||
15 | { |
||
16 | /** |
||
17 | * @var bool |
||
18 | */ |
||
19 | private $fusion = false; |
||
20 | |||
21 | /** |
||
22 | * @return Promised |
||
23 | */ |
||
24 | public function fusion() : Promised |
||
25 | { |
||
26 | $this->fusion = true; |
||
27 | |||
28 | $this->catch(static function (Throwable $e = null) { |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
29 | if ($e) { |
||
30 | throw $e; |
||
31 | } |
||
32 | }); |
||
33 | |||
34 | /** |
||
35 | * @var Promised $this |
||
36 | */ |
||
37 | |||
38 | return $this; |
||
39 | } |
||
40 | } |
||
41 |