Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 527d380

Browse files
author
Yuriy Golikov
committed
Initialize result message with empty string instead of null
1 parent 392dd21 commit 527d380

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@ All notable changes to this project will be documented in this file, in reverse
44

55
Releases prior to 1.2.0 did not have entries.
66

7+
## 1.3.2 - 2018-09-16
8+
9+
### Added
10+
11+
- Nothing.
12+
13+
### Changed
14+
15+
- AbstractResult message default value is empty string.
16+
17+
### Deprecated
18+
19+
- Nothing.
20+
21+
### Removed
22+
23+
- Nothing.
24+
25+
### Fixed
26+
27+
- Nothing.
28+
729
## 1.3.1 - TBD
830

931
### Added

src/Result/AbstractResult.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
abstract class AbstractResult implements ResultInterface
1414
{
1515
/**
16-
* @var string|null
16+
* @var string
1717
*/
1818
protected $message;
1919

@@ -25,14 +25,12 @@ abstract class AbstractResult implements ResultInterface
2525
/**
2626
* Create new result
2727
*
28-
* @param string|null $message
28+
* @param string $message
2929
* @param mixed|null $data
3030
*/
31-
public function __construct($message = null, $data = null)
31+
public function __construct($message = '', $data = null)
3232
{
33-
if ($message !== null) {
34-
$this->setMessage($message);
35-
}
33+
$this->setMessage($message);
3634

3735
if ($data !== null) {
3836
$this->setData($data);
@@ -68,7 +66,7 @@ public function setData($data)
6866
}
6967

7068
/**
71-
* @param null|string $message
69+
* @param string $message
7270
*/
7371
public function setMessage($message)
7472
{

0 commit comments

Comments
 (0)