1 | <?php |
||
13 | class Response |
||
14 | { |
||
15 | /** |
||
16 | * @var ChannelInterface |
||
17 | */ |
||
18 | protected $channel; |
||
19 | |||
20 | /** |
||
21 | * @var ProtocolInterface |
||
22 | */ |
||
23 | protected $protocol; |
||
24 | |||
25 | /** |
||
26 | * @var string|string[]|Error|Exception |
||
27 | */ |
||
28 | protected $message; |
||
29 | |||
30 | /** |
||
31 | * @var mixed[] |
||
32 | */ |
||
33 | protected $params; |
||
34 | |||
35 | /** |
||
36 | * @param ChannelInterface $channel |
||
37 | * @param ProtocolInterface $protocol |
||
38 | * @param string|string[]|Error|Exception $message |
||
39 | * @param mixed[] $params |
||
40 | */ |
||
41 | 6 | public function __construct($channel, $protocol, $message, $params = []) |
|
48 | |||
49 | /** |
||
50 | * |
||
51 | */ |
||
52 | 2 | public function __destruct() |
|
59 | |||
60 | /** |
||
61 | * Send the prepared response. |
||
62 | * |
||
63 | * @return PromiseInterface |
||
64 | */ |
||
65 | 1 | public function __invoke() |
|
69 | |||
70 | /** |
||
71 | * Send the prepared response. |
||
72 | * |
||
73 | * @return PromiseInterface |
||
74 | * @resolves mixed |
||
75 | * @rejects Error|Exception|string|null |
||
76 | * @cancels Error|Exception|string|null |
||
77 | */ |
||
78 | 1 | public function call() |
|
82 | |||
83 | /** |
||
84 | * Send the request using passed Promise. |
||
85 | * |
||
86 | * @param PromiseInterface $promise |
||
87 | * @return PromiseInterface |
||
88 | * @resolves mixed |
||
89 | * @rejects Error|Exception|string|null |
||
90 | * @cancels Error|Exception|string|null |
||
91 | */ |
||
92 | 2 | protected function send(PromiseInterface $promise) |
|
123 | } |
||
124 |