77 * Time: 6:49 PM
88 */
99
10+ declare (strict_types = 1 );
11+
1012namespace Dot \Controller \Plugin \FlashMessenger ;
1113
1214use Dot \Controller \Plugin \PluginInterface ;
@@ -31,70 +33,80 @@ public function __construct(FlashMessengerInterface $flashMessenger)
3133 }
3234
3335 /**
34- * @param string $namespace
36+ * @param string $type
37+ * @param string $channel
3538 * @param mixed $value
3639 */
37- public function addMessage ($ namespace , $ value )
40+ public function addMessage (string $ type , $ value, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
3841 {
39- $ this ->flashMessenger ->addMessage ($ namespace , $ value );
42+ $ this ->flashMessenger ->addMessage ($ type , $ value, $ channel );
4043 }
4144
4245 /**
43- * @param $key
44- * @param $value
46+ * @param string $key
47+ * @param string $channel
48+ * @param mixed $value
4549 */
46- public function addData ($ key , $ value )
50+ public function addData (string $ key , $ value, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
4751 {
48- $ this ->flashMessenger ->addData ($ key , $ value );
52+ $ this ->flashMessenger ->addData ($ key , $ value, $ channel );
4953 }
5054
5155 /**
52- * @param $error
56+ * @param mixed $error
57+ * @param string $channel
5358 */
54- public function addError ($ error )
59+ public function addError ($ error, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
5560 {
56- $ this ->flashMessenger ->addError ($ error );
61+ $ this ->flashMessenger ->addError ($ error, $ channel );
5762 }
5863
5964 /**
60- * @param $message
65+ * @param mixed $message
66+ * @param string $channel
6167 */
62- public function addWarning ($ message )
68+ public function addWarning ($ message, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
6369 {
64- $ this ->flashMessenger ->addWarning ($ message );
70+ $ this ->flashMessenger ->addWarning ($ message, $ channel );
6571 }
6672
6773 /**
68- * @param $message
74+ * @param mixed $message
75+ * @param string $channel
6976 */
70- public function addInfo ($ message )
77+ public function addInfo ($ message, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
7178 {
72- $ this ->flashMessenger ->addInfo ($ message );
79+ $ this ->flashMessenger ->addInfo ($ message, $ channel );
7380 }
7481
7582 /**
76- * @param $message
83+ * @param mixed $message
84+ * @param string $channel
7785 */
78- public function addSuccess ($ message )
86+ public function addSuccess ($ message, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
7987 {
80- $ this ->flashMessenger ->addSuccess ($ message );
88+ $ this ->flashMessenger ->addSuccess ($ message, $ channel );
8189 }
8290
8391 /**
84- * @param $namespace
85- * @return array|null
92+ * @param string $type
93+ * @param string $channel
94+ * @return array
8695 */
87- public function getMessages ($ namespace = null )
88- {
89- return $ this ->flashMessenger ->getMessages ($ namespace );
96+ public function getMessages (
97+ string $ type = null ,
98+ string $ channel = FlashMessengerInterface::DEFAULT_CHANNEL
99+ ): array {
100+ return $ this ->flashMessenger ->getMessages ($ type , $ channel );
90101 }
91102
92103 /**
93- * @param $key
104+ * @param string $key
105+ * @param string $channel
94106 * @return mixed
95107 */
96- public function getData ($ key )
108+ public function getData (string $ key, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
97109 {
98- return $ this ->flashMessenger ->getData ($ key );
110+ return $ this ->flashMessenger ->getData ($ key, $ channel );
99111 }
100112}
0 commit comments