1 | <?php |
||
6 | trait DiscussThreadPresenter |
||
7 | { |
||
8 | /** |
||
9 | * Get the content parsed in HTML. |
||
10 | * |
||
11 | * @return string |
||
12 | */ |
||
13 | public function getContentMarkdownAttribute(): string |
||
17 | |||
18 | /** |
||
19 | * Get the thread url. |
||
20 | * |
||
21 | * @return string |
||
22 | */ |
||
23 | public function getThreadUrlAttribute(): string |
||
31 | |||
32 | /** |
||
33 | * Get the last page number for the thread. |
||
34 | * |
||
35 | * @return int |
||
36 | */ |
||
37 | public function getLastPageAttribute(): int |
||
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: