This repository was archived by the owner on Jan 31, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ Releases prior to 1.2.0 did not have entries.
26
26
27
27
- Nothing.
28
28
29
- ## 1.3.1 - TBD
29
+ ## 1.3.1 - 2018-09-17
30
30
31
31
### Added
32
32
@@ -46,7 +46,11 @@ Releases prior to 1.2.0 did not have entries.
46
46
47
47
### Fixed
48
48
49
- - Nothing.
49
+ - [ #94 ] ( https://github.com/zendframework/zenddiagnostics/pull/94 ) updates the
50
+ ` AbstractResult::$message ` property to default to an empty string instead of
51
+ ` null ` . Since both ` ResultInterface ` and ` AbstractResult ` document that the
52
+ return type for ` getMessage() ` is a string, and all reporters expect a string,
53
+ this ensures type safety for the method.
50
54
51
55
## 1.3.0 - 2018-07-30
52
56
Original file line number Diff line number Diff line change 13
13
abstract class AbstractResult implements ResultInterface
14
14
{
15
15
/**
16
- * @var string|null
16
+ * @var string
17
17
*/
18
18
protected $ message ;
19
19
@@ -25,14 +25,12 @@ abstract class AbstractResult implements ResultInterface
25
25
/**
26
26
* Create new result
27
27
*
28
- * @param string|null $message
28
+ * @param string $message
29
29
* @param mixed|null $data
30
30
*/
31
- public function __construct ($ message = null , $ data = null )
31
+ public function __construct ($ message = '' , $ data = null )
32
32
{
33
- if ($ message !== null ) {
34
- $ this ->setMessage ($ message );
35
- }
33
+ $ this ->setMessage ($ message );
36
34
37
35
if ($ data !== null ) {
38
36
$ this ->setData ($ data );
@@ -68,7 +66,7 @@ public function setData($data)
68
66
}
69
67
70
68
/**
71
- * @param null| string $message
69
+ * @param string $message
72
70
*/
73
71
public function setMessage ($ message )
74
72
{
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ public function testConstructor()
77
77
public function testSetters ()
78
78
{
79
79
$ result = new Success ();
80
- $ this ->assertSame (null , $ result ->getMessage ());
80
+ $ this ->assertSame ('' , $ result ->getMessage ());
81
81
$ this ->assertSame (null , $ result ->getData ());
82
82
83
83
$ result ->setMessage ('foo ' );
You can’t perform that action at this time.
0 commit comments