]> BookStack Code Mirror - bookstack/blob - app/Activity/Notifications/MessageParts/ListMessageLine.php
Notifications: Cleaned up mails, added debounce for updates
[bookstack] / app / Activity / Notifications / MessageParts / ListMessageLine.php
1 <?php
2
3 namespace BookStack\Activity\Notifications\MessageParts;
4
5 use Illuminate\Contracts\Support\Htmlable;
6
7 /**
8  * A bullet point list of content, where the keys of the given list array
9  * are bolded header elements, and the values follow.
10  */
11 class ListMessageLine implements Htmlable
12 {
13     public function __construct(
14         protected array $list
15     ) {
16     }
17
18     public function toHtml(): string
19     {
20         $list = [];
21         foreach ($this->list as $header => $content) {
22             $list[] = '<strong>' . e($header) . '</strong> ' . e($content);
23         }
24         return implode("<br>\n", $list);
25     }
26 }