Total Complexity | 6 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
9 | class CommentPresenter |
||
10 | { |
||
11 | /** |
||
12 | * @var Comment |
||
13 | */ |
||
14 | public Comment $comment; |
||
15 | |||
16 | /** |
||
17 | * @param Comment $comment |
||
18 | */ |
||
19 | public function __construct(Comment $comment) |
||
20 | { |
||
21 | $this->comment = $comment; |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @return HtmlString |
||
26 | */ |
||
27 | public function markdownBody(): HtmlString |
||
28 | { |
||
29 | return new HtmlString(app('markdown')->convertToHtml($this->comment->body)); |
||
|
|||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @return mixed |
||
34 | */ |
||
35 | public function relativeCreatedAt(): mixed |
||
36 | { |
||
37 | return $this->comment->created_at->diffForHumans(); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @param $text |
||
42 | * @return array|string |
||
43 | */ |
||
44 | public function replaceUserMentions($text): array|string |
||
64 | } |
||
65 | |||
66 | |||
67 | } |
||
68 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.