7
7
* Time: 6:49 PM
8
8
*/
9
9
10
+ declare (strict_types = 1 );
11
+
10
12
namespace Dot \Controller \Plugin \FlashMessenger ;
11
13
12
14
use Dot \Controller \Plugin \PluginInterface ;
@@ -31,70 +33,80 @@ public function __construct(FlashMessengerInterface $flashMessenger)
31
33
}
32
34
33
35
/**
34
- * @param string $namespace
36
+ * @param string $type
37
+ * @param string $channel
35
38
* @param mixed $value
36
39
*/
37
- public function addMessage ($ namespace , $ value )
40
+ public function addMessage (string $ type , $ value, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
38
41
{
39
- $ this ->flashMessenger ->addMessage ($ namespace , $ value );
42
+ $ this ->flashMessenger ->addMessage ($ type , $ value, $ channel );
40
43
}
41
44
42
45
/**
43
- * @param $key
44
- * @param $value
46
+ * @param string $key
47
+ * @param string $channel
48
+ * @param mixed $value
45
49
*/
46
- public function addData ($ key , $ value )
50
+ public function addData (string $ key , $ value, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
47
51
{
48
- $ this ->flashMessenger ->addData ($ key , $ value );
52
+ $ this ->flashMessenger ->addData ($ key , $ value, $ channel );
49
53
}
50
54
51
55
/**
52
- * @param $error
56
+ * @param mixed $error
57
+ * @param string $channel
53
58
*/
54
- public function addError ($ error )
59
+ public function addError ($ error, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
55
60
{
56
- $ this ->flashMessenger ->addError ($ error );
61
+ $ this ->flashMessenger ->addError ($ error, $ channel );
57
62
}
58
63
59
64
/**
60
- * @param $message
65
+ * @param mixed $message
66
+ * @param string $channel
61
67
*/
62
- public function addWarning ($ message )
68
+ public function addWarning ($ message, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
63
69
{
64
- $ this ->flashMessenger ->addWarning ($ message );
70
+ $ this ->flashMessenger ->addWarning ($ message, $ channel );
65
71
}
66
72
67
73
/**
68
- * @param $message
74
+ * @param mixed $message
75
+ * @param string $channel
69
76
*/
70
- public function addInfo ($ message )
77
+ public function addInfo ($ message, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
71
78
{
72
- $ this ->flashMessenger ->addInfo ($ message );
79
+ $ this ->flashMessenger ->addInfo ($ message, $ channel );
73
80
}
74
81
75
82
/**
76
- * @param $message
83
+ * @param mixed $message
84
+ * @param string $channel
77
85
*/
78
- public function addSuccess ($ message )
86
+ public function addSuccess ($ message, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
79
87
{
80
- $ this ->flashMessenger ->addSuccess ($ message );
88
+ $ this ->flashMessenger ->addSuccess ($ message, $ channel );
81
89
}
82
90
83
91
/**
84
- * @param $namespace
85
- * @return array|null
92
+ * @param string $type
93
+ * @param string $channel
94
+ * @return array
86
95
*/
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 );
90
101
}
91
102
92
103
/**
93
- * @param $key
104
+ * @param string $key
105
+ * @param string $channel
94
106
* @return mixed
95
107
*/
96
- public function getData ($ key )
108
+ public function getData (string $ key, string $ channel = FlashMessengerInterface:: DEFAULT_CHANNEL )
97
109
{
98
- return $ this ->flashMessenger ->getData ($ key );
110
+ return $ this ->flashMessenger ->getData ($ key, $ channel );
99
111
}
100
112
}
0 commit comments