1 | <?php |
||
15 | final class Message |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $channel; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private $params; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | private $options; |
||
31 | |||
32 | /** |
||
33 | * Initializes a new instance of this class. |
||
34 | * |
||
35 | * @param string $channel The name of the channel to broadcast the message to. |
||
36 | * @param array $params The parameters that belong to the message. |
||
37 | * @param array $options Options that can be passed along to the transport. |
||
38 | */ |
||
39 | public function __construct(string $channel, array $params, array $options) |
||
49 | |||
50 | /** |
||
51 | * Gets the value of field "channel". |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getChannel(): string |
||
59 | |||
60 | /** |
||
61 | * Gets the value of field "params". |
||
62 | * |
||
63 | * @return array |
||
64 | */ |
||
65 | public function getParams(): array |
||
69 | |||
70 | /** |
||
71 | * Gets the parameter with the given name. |
||
72 | * |
||
73 | * @param string $name |
||
74 | * @param mixed $default |
||
75 | * @return mixed |
||
76 | */ |
||
77 | public function getParam(string $name, $default = null) |
||
85 | |||
86 | /** |
||
87 | * Gets the value of field "options". |
||
88 | * |
||
89 | * @return array |
||
90 | */ |
||
91 | public function getOptions(): array |
||
95 | |||
96 | /** |
||
97 | * Gets the option with the given name. |
||
98 | * |
||
99 | * @param string $name |
||
100 | * @param mixed $default |
||
101 | * @return mixed |
||
102 | */ |
||
103 | public function getOption(string $name, $default = null) |
||
111 | } |
||
112 |