1 | <?php |
||
5 | trait FlashStubs |
||
6 | { |
||
7 | /** |
||
8 | * Base method for adding messages to flash. |
||
9 | * |
||
10 | * @param string $message - message text |
||
11 | * @param string $type - message type: success, info, warning, error |
||
12 | * |
||
13 | * @return Engine $this |
||
14 | */ |
||
15 | 48 | public static function message($message, $type = 'info') |
|
19 | |||
20 | /** |
||
21 | * Returns Bootstrap ready HTML for Engine messages. |
||
22 | * |
||
23 | * @param string $type - message type: success, info, warning, error |
||
24 | * |
||
25 | * @return string - HTML with flash messages |
||
26 | */ |
||
27 | 24 | public static function display($type = null) |
|
31 | |||
32 | /** |
||
33 | * Returns if there are any messages in container. |
||
34 | * |
||
35 | * @param string $type - message type: success, info, warning, error |
||
36 | * |
||
37 | * @return bool |
||
38 | */ |
||
39 | 18 | public static function hasMessages($type = null) |
|
43 | |||
44 | /** |
||
45 | * Clears messages from session store. |
||
46 | * |
||
47 | * @param string $type - message type: success, info, warning, error |
||
48 | * |
||
49 | * @return Engine $this |
||
50 | */ |
||
51 | 6 | public static function clear($type = null) |
|
55 | |||
56 | /** |
||
57 | * Shortcut for error message. |
||
58 | * |
||
59 | * @param $message - message text |
||
60 | * |
||
61 | * @return Engine $this |
||
62 | */ |
||
63 | 3 | public static function error($message) |
|
67 | |||
68 | /** |
||
69 | * Shortcut for warning message. |
||
70 | * |
||
71 | * @param $message - message text |
||
72 | * |
||
73 | * @return Engine $this |
||
74 | */ |
||
75 | public static function warning($message) |
||
79 | |||
80 | /** |
||
81 | * Shortcut for info message. |
||
82 | * |
||
83 | * @param $message - message text |
||
84 | * |
||
85 | * @return Engine $this |
||
86 | */ |
||
87 | 21 | public static function info($message) |
|
91 | |||
92 | /** |
||
93 | * Shortcut for success message. |
||
94 | * |
||
95 | * @param $message - message text |
||
96 | * |
||
97 | * @return Engine $this |
||
98 | */ |
||
99 | public static function success($message) |
||
103 | |||
104 | /** |
||
105 | * Setter for $template. |
||
106 | * |
||
107 | * @param TemplateInterface $template |
||
108 | * |
||
109 | * @return Engine $this |
||
110 | */ |
||
111 | 15 | public static function setTemplate(TemplateInterface $template) |
|
115 | |||
116 | /** |
||
117 | * Getter for $template. |
||
118 | * |
||
119 | * @return TemplateInterface |
||
120 | */ |
||
121 | 3 | public static function getTemplate() |
|
125 | } |
||
126 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.