1 | <?php |
||
11 | class Notify |
||
12 | { |
||
13 | const NOTIFICATIONS_NAMESPACE = 'notify::notifications'; |
||
14 | |||
15 | /** |
||
16 | * Added notifications. |
||
17 | * |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $notifications = []; |
||
21 | |||
22 | /** |
||
23 | * Illuminate Session. |
||
24 | * |
||
25 | * @var \Illuminate\Session\SessionManager |
||
26 | */ |
||
27 | protected $session; |
||
28 | |||
29 | /** |
||
30 | * Notification config. |
||
31 | * |
||
32 | * @var \Illuminate\Config\Repository |
||
33 | */ |
||
34 | protected $config; |
||
35 | |||
36 | /** @var NotifyInterface */ |
||
37 | protected $notifier; |
||
38 | |||
39 | /** |
||
40 | * Notification constructor. |
||
41 | * |
||
42 | * @param NotifierInterface $notifier |
||
43 | * @param SessionManager $session |
||
44 | * @param Repository $config |
||
45 | */ |
||
46 | public function __construct(NotifierInterface $notifier, SessionManager $session, Repository $config) |
||
56 | |||
57 | /** |
||
58 | * Add a notification. |
||
59 | * |
||
60 | * @param string $type Could be error, info, success, or warning. |
||
61 | * @param string $message The notification's message |
||
62 | * @param string $title The notification's title |
||
63 | * @param array $options |
||
64 | * |
||
65 | * @return self |
||
66 | */ |
||
67 | public function addNotification(string $type, string $message, string $title = '', array $options = []): self |
||
84 | |||
85 | /** |
||
86 | * helper function to escape single quote for example for french words. |
||
87 | * |
||
88 | * @param string $value |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | private function escapeSingleQuote(string $value): string |
||
96 | |||
97 | /** |
||
98 | * Render the notifications' script tag. |
||
99 | * |
||
100 | * @return string |
||
101 | */ |
||
102 | public function render(): string |
||
110 | |||
111 | /** |
||
112 | * Clear all notifications. |
||
113 | * |
||
114 | * @return self |
||
115 | */ |
||
116 | public function clear(): self |
||
124 | |||
125 | /** |
||
126 | * @param $method |
||
127 | * @param $arguments |
||
128 | */ |
||
129 | public function __call($method, $arguments) |
||
137 | } |
||
138 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..