File tree Expand file tree Collapse file tree 7 files changed +47
-22
lines changed Expand file tree Collapse file tree 7 files changed +47
-22
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ class Debug extends Message {
11
11
/**
12
12
* Constructs the debug.
13
13
* @param string $message - the message text.
14
+ * @param mixed $data - custom additional data for application specific usage.
14
15
*/
15
- public function __construct ($ message ) {
16
- parent ::__construct ('debug ' , $ message );
16
+ public function __construct ($ message, $ data = NULL ) {
17
+ parent ::__construct ('debug ' , $ message, $ data );
17
18
}
18
19
19
- }
20
+ }
Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ class Error extends Message {
11
11
/**
12
12
* Constructs the error.
13
13
* @param string $message - the message text.
14
+ * @param mixed $data - custom additional data for application specific usage.
14
15
*/
15
- public function __construct ($ message ) {
16
- parent ::__construct ('error ' , $ message );
16
+ public function __construct ($ message, $ data = NULL ) {
17
+ parent ::__construct ('error ' , $ message, $ data );
17
18
}
18
19
19
- }
20
+ }
Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ class Info extends Message {
11
11
/**
12
12
* Constructs the info.
13
13
* @param string $message - the message text.
14
+ * @param mixed $data - custom additional data for application specific usage.
14
15
*/
15
- public function __construct ($ message ) {
16
- parent ::__construct ('info ' , $ message );
16
+ public function __construct ($ message, $ data = NULL ) {
17
+ parent ::__construct ('info ' , $ message, $ data );
17
18
}
18
19
19
- }
20
+ }
Original file line number Diff line number Diff line change 12
12
*/
13
13
class Log {
14
14
15
- public const NONE = 'none ' ;
16
- public const DEBUG = 'debug ' ;
17
- public const INFO = 'info ' ;
18
- public const WARN = 'warn ' ;
19
- public const ERROR = 'error ' ;
15
+ public const NONE = 'none ' ;
16
+ public const DEBUG = 'debug ' ;
17
+ public const INFO = 'info ' ;
18
+ public const WARN = 'warn ' ;
19
+ public const ERROR = 'error ' ;
20
+ public const SUCCESS = 'success ' ;
20
21
21
22
/** The available log priorities */
22
23
protected static $ logPriorities ;
Original file line number Diff line number Diff line change @@ -10,10 +10,12 @@ class Message {
10
10
11
11
protected $ type ;
12
12
protected $ message ;
13
+ protected $ data ;
13
14
14
- public function __construct ($ type , $ message ) {
15
+ public function __construct ($ type , $ message, $ data = NULL ) {
15
16
$ this ->type = $ type ;
16
17
$ this ->message = $ message ;
18
+ $ this ->data = $ data ;
17
19
}
18
20
19
21
/**
@@ -31,4 +33,21 @@ public function getType() {
31
33
public function getMessage () {
32
34
return $ this ->message ;
33
35
}
34
- }
36
+
37
+ /**
38
+ * Sets the custom additonal data
39
+ * @param mixed $data - the data.
40
+ */
41
+ public function setData ($ data ) {
42
+ $ this ->data = $ data ;
43
+ return $ this ;
44
+ }
45
+
46
+ /**
47
+ * Returns the custom additonal data
48
+ * @return mixed the data.
49
+ */
50
+ public function getData () {
51
+ return $ this ->data ;
52
+ }
53
+ }
Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ class Success extends Message {
11
11
/**
12
12
* Constructs the success message.
13
13
* @param string $message - the message text.
14
+ * @param mixed $data - custom additional data for application specific usage.
14
15
*/
15
- public function __construct ($ message ) {
16
- parent ::__construct ('success ' , $ message );
16
+ public function __construct ($ message, $ data = NULL ) {
17
+ parent ::__construct ('success ' , $ message, $ data );
17
18
}
18
19
19
- }
20
+ }
Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ class Warning extends Message {
11
11
/**
12
12
* Constructs the warning.
13
13
* @param string $message - the message text.
14
+ * @param mixed $data - custom additional data for application specific usage.
14
15
*/
15
- public function __construct ($ message ) {
16
- parent ::__construct ('warning ' , $ message );
16
+ public function __construct ($ message, $ data = NULL ) {
17
+ parent ::__construct ('warning ' , $ message, $ data );
17
18
}
18
19
19
- }
20
+ }
You can’t perform that action at this time.
0 commit comments