1 | <?php |
||
18 | abstract class Transformer |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Strips HTML tags from the given string. |
||
23 | * @param string $message The string that does/may contain HTML tags. |
||
24 | * @return string |
||
25 | */ |
||
26 | 18 | protected function stripHtml($message) |
|
30 | |||
31 | /** |
||
32 | * Retrieves the formatted text. |
||
33 | * @return string |
||
34 | */ |
||
35 | 18 | public function get() |
|
39 | |||
40 | /** |
||
41 | * Default __toString() method to return the formatted text. |
||
42 | * @return string |
||
43 | */ |
||
44 | 18 | public function __toString() |
|
48 | } |
||
49 |
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: