1 | <?php |
||
5 | class MessagebirdMessage |
||
6 | { |
||
7 | public $body; |
||
8 | public $originator; |
||
9 | public $recipients; |
||
10 | public $reference; |
||
11 | |||
12 | 2 | public static function create($body = '') |
|
16 | |||
17 | 12 | public function __construct($body = '') |
|
23 | |||
24 | 1 | public function setBody($body) |
|
30 | |||
31 | 4 | public function setOriginator($originator) |
|
37 | |||
38 | 7 | public function setRecipients($recipients) |
|
48 | |||
49 | 2 | public function setReference($reference) |
|
55 | |||
56 | 1 | public function setDatacoding($datacoding) |
|
62 | |||
63 | |||
64 | 1 | public function toJson() |
|
68 | } |
||
69 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: