1 | <?php |
||
18 | class CakeLogEntry |
||
19 | { |
||
20 | /** |
||
21 | * Constructor |
||
22 | * |
||
23 | * @param string $text log entry text |
||
24 | */ |
||
25 | public function __construct($text) |
||
42 | |||
43 | /** |
||
44 | * Gets log entry time |
||
45 | * |
||
46 | * @return string |
||
47 | */ |
||
48 | public function time() |
||
52 | |||
53 | /** |
||
54 | * Gets log entry type |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | public function type() |
||
62 | |||
63 | /** |
||
64 | * Gets log entry message |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | public function message() |
||
72 | |||
73 | /** |
||
74 | * Gets log entry details |
||
75 | * |
||
76 | * @return string |
||
77 | */ |
||
78 | public function details() |
||
82 | } |
||
83 |
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: