Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| Message | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
30 | |
0.00% |
0 / 1 |
| encode | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
30 | |||
| 1 | <?php |
| 2 | namespace Ably\Models; |
| 3 | |
| 4 | class Message extends BaseMessage { |
| 5 | |
| 6 | /** |
| 7 | * @var string|null The event name of the message. |
| 8 | */ |
| 9 | public $name; |
| 10 | |
| 11 | /** |
| 12 | * @var string|null Connection key from a realtime connection, |
| 13 | * when publishing on behalf of it. |
| 14 | */ |
| 15 | public $connectionKey; |
| 16 | |
| 17 | protected function encode() { |
| 18 | $msg = parent::encode(); |
| 19 | |
| 20 | if ( isset( $this->name ) && $this->name ) { |
| 21 | $msg->name = $this->name; |
| 22 | } |
| 23 | |
| 24 | if ( isset( $this->connectionKey ) && $this->connectionKey ) { |
| 25 | $msg->connectionKey = $this->connectionKey; |
| 26 | } |
| 27 | |
| 28 | return $msg; |
| 29 | } |
| 30 | |
| 31 | } |