| 1 | <?php |
||
| 21 | class Message |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * The name of sender |
||
| 25 | * |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | private $sender; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * The text of message |
||
| 32 | * |
||
| 33 | * @var string |
||
| 34 | */ |
||
| 35 | private $message; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Constructor. |
||
| 39 | * |
||
| 40 | * @param string $message |
||
| 41 | * @param string $sender |
||
| 42 | */ |
||
| 43 | 4 | public function __construct(string $message, string $sender = null) |
|
| 48 | |||
| 49 | /** |
||
| 50 | * Get the name of sender |
||
| 51 | * |
||
| 52 | * @return null|string |
||
| 53 | */ |
||
| 54 | 3 | public function getSender(): ?string |
|
| 58 | |||
| 59 | /** |
||
| 60 | * Get the text of message |
||
| 61 | * |
||
| 62 | * @return string |
||
| 63 | */ |
||
| 64 | 3 | public function getMessage(): string |
|
| 68 | } |
||
| 69 |