1 | <?php |
||
7 | abstract class AbstractNotifier |
||
8 | { |
||
9 | /** @var array */ |
||
10 | protected $config; |
||
11 | |||
12 | /** |
||
13 | * Toastr constructor. |
||
14 | * |
||
15 | * @param array $config |
||
16 | */ |
||
17 | public function __construct(array $config) |
||
21 | |||
22 | /** |
||
23 | * Render the notifications' script tag. |
||
24 | * |
||
25 | * @param array $notifications |
||
26 | * |
||
27 | * @return string |
||
28 | */ |
||
29 | public function render(array $notifications): string |
||
33 | |||
34 | /** |
||
35 | * Get global toastr options. |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | public function options(): string |
||
43 | |||
44 | /** |
||
45 | * @param array $notifications |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | public function notificationsAsString(array $notifications): string |
||
53 | |||
54 | /** |
||
55 | * map over all notifications and create an array of toastrs. |
||
56 | * |
||
57 | * @param array $notifications |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | public function notifications(array $notifications): array |
||
70 | |||
71 | /** |
||
72 | * Create a single notification. |
||
73 | * |
||
74 | * @param string $type |
||
75 | * @param string $message |
||
76 | * @param string|null $title |
||
77 | * @param string|null $options |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | abstract public function notify(string $type, string $message = '', string $title = '', string $options = ''): string; |
||
82 | |||
83 | /** |
||
84 | * Get Allowed Types |
||
85 | * |
||
86 | * @return array |
||
87 | */ |
||
88 | public function getAllowedTypes(): array |
||
92 | |||
93 | /** |
||
94 | * @return string |
||
95 | */ |
||
96 | public function getName(): string |
||
100 | } |
||
101 |