1 | <?php |
||
22 | class Notification implements ViewInterface |
||
23 | { |
||
24 | /** |
||
25 | * instance of the language class |
||
26 | * |
||
27 | * @var Language |
||
28 | */ |
||
29 | |||
30 | protected $_language; |
||
31 | |||
32 | /** |
||
33 | * array of the notification |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | |||
38 | protected $_notificationArray = []; |
||
39 | |||
40 | /** |
||
41 | * options of the notification |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | |||
46 | protected $_optionArray = |
||
47 | [ |
||
48 | 'className' => |
||
49 | [ |
||
50 | 'list' => 'rs-admin-list-notification', |
||
51 | 'item' => 'rs-admin-item-notification rs-admin-item-note', |
||
52 | 'title' => 'rs-admin-title-notification', |
||
53 | 'link' => 'rs-admin-link-notification', |
||
54 | 'text' => 'rs-admin-text-notification', |
||
55 | 'note' => |
||
56 | [ |
||
57 | 'success' => 'rs-admin-is-success', |
||
58 | 'warning' => 'rs-admin-is-warning', |
||
59 | 'error' => 'rs-admin-is-error', |
||
60 | 'info' => 'rs-admin-is-info' |
||
61 | ] |
||
62 | ] |
||
63 | ]; |
||
64 | |||
65 | /** |
||
66 | * constructor of the class |
||
67 | * |
||
68 | * @since 4.0.0 |
||
69 | * |
||
70 | * @param Language $language instance of the language class |
||
71 | */ |
||
72 | |||
73 | 1 | public function __construct(Language $language) |
|
74 | { |
||
75 | 1 | $this->_language = $language; |
|
76 | 1 | } |
|
77 | |||
78 | /** |
||
79 | * init the class |
||
80 | * |
||
81 | * @since 4.0.0 |
||
82 | * |
||
83 | * @param array $optionArray options of the notification |
||
84 | */ |
||
85 | |||
86 | 1 | public function init(array $optionArray = []) : void |
|
87 | { |
||
88 | 1 | $this->_optionArray = array_replace_recursive($this->_optionArray, $optionArray); |
|
89 | 1 | $this->_notificationArray = Module\Hook::collect('adminNotification'); |
|
90 | 1 | } |
|
91 | |||
92 | /** |
||
93 | * render the view |
||
94 | * |
||
95 | * @since 4.0.0 |
||
96 | * |
||
97 | * @return string|null |
||
98 | */ |
||
99 | |||
100 | 1 | public function render() : ?string |
|
167 | |||
168 | /** |
||
169 | * get the meta array |
||
170 | * |
||
171 | * @since 4.0.0 |
||
172 | * |
||
173 | * @return array |
||
174 | */ |
||
175 | |||
176 | public function getMetaArray() : array |
||
192 | } |
||
193 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: