Completed
Push — master ( 251e80...6a4caa )
by Yuri
02:28
created

FlashStubs::success()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Tamtamchik\SimpleFlash;
4
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')
0 ignored issues
show
Unused Code introduced by
The parameter $message is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
16
    {
17 48
        return self::__callStatic(__FUNCTION__, func_get_args());
18
    }
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)
0 ignored issues
show
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
28
    {
29 24
        return self::__callStatic(__FUNCTION__, func_get_args());
30
    }
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)
0 ignored issues
show
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
40
    {
41 18
        return self::__callStatic(__FUNCTION__, func_get_args());
42
    }
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)
0 ignored issues
show
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
52
    {
53 6
        return self::__callStatic(__FUNCTION__, func_get_args());
54
    }
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)
0 ignored issues
show
Unused Code introduced by
The parameter $message is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
64
    {
65 3
        return self::__callStatic(__FUNCTION__, func_get_args());
66
    }
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)
0 ignored issues
show
Unused Code introduced by
The parameter $message is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
76
    {
77
        return self::__callStatic(__FUNCTION__, func_get_args());
78
    }
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)
0 ignored issues
show
Unused Code introduced by
The parameter $message is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
88
    {
89 21
        return self::__callStatic(__FUNCTION__, func_get_args());
90
    }
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)
0 ignored issues
show
Unused Code introduced by
The parameter $message is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
100
    {
101
        return self::__callStatic(__FUNCTION__, func_get_args());
102
    }
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)
0 ignored issues
show
Unused Code introduced by
The parameter $template is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
112
    {
113 15
        return self::__callStatic(__FUNCTION__, func_get_args());
114
    }
115
116
    /**
117
     * Getter for $template.
118
     *
119
     * @return TemplateInterface
120
     */
121 3
    public static function getTemplate()
122
    {
123 3
        return self::__callStatic(__FUNCTION__, func_get_args());
124
    }
125
}
126