1 | <?php |
||
5 | class MessagebirdMessage |
||
6 | { |
||
7 | public $body; |
||
8 | public $originator; |
||
9 | public $recipients; |
||
10 | public $reference; |
||
11 | |||
12 | public static function create($body = '') |
||
16 | |||
17 | public function __construct($body = '') |
||
23 | |||
24 | public function setBody($body) |
||
30 | |||
31 | public function setOriginator($originator) |
||
37 | |||
38 | public function setRecipients($recipients) |
||
48 | |||
49 | public function setReference($reference) |
||
55 | |||
56 | public function setDatacoding($datacoding) |
||
62 | |||
63 | public function toJson() |
||
67 | } |
||
68 |
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: