Total Complexity | 5 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class Request |
||
11 | { |
||
12 | /** |
||
13 | * @var Deferred |
||
14 | */ |
||
15 | private $deferred; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $command; |
||
21 | |||
22 | /** |
||
23 | * @param string $command |
||
24 | */ |
||
25 | public function __construct($command) |
||
26 | { |
||
27 | $this->deferred = new Deferred(); |
||
28 | $this->command = $command; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @return string |
||
33 | */ |
||
34 | public function command() |
||
35 | { |
||
36 | return $this->command; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @return Promise|PromiseInterface |
||
41 | */ |
||
42 | public function promise() |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * @param mixed $value |
||
49 | */ |
||
50 | public function resolve($value) |
||
51 | { |
||
52 | $this->deferred->resolve($value); |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @param Exception $exception |
||
57 | */ |
||
58 | public function reject(Exception $exception) |
||
61 | } |
||
62 | } |
||
63 |