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

Commit

Permalink
Initialize result message with empty string instead of null
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuriy Golikov committed Sep 16, 2018
1 parent 392dd21 commit 527d380
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@ All notable changes to this project will be documented in this file, in reverse

Releases prior to 1.2.0 did not have entries.

## 1.3.2 - 2018-09-16

### Added

- Nothing.

### Changed

- AbstractResult message default value is empty string.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.

## 1.3.1 - TBD

### Added
Expand Down
12 changes: 5 additions & 7 deletions src/Result/AbstractResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
abstract class AbstractResult implements ResultInterface
{
/**
* @var string|null
* @var string
*/
protected $message;

Expand All @@ -25,14 +25,12 @@ abstract class AbstractResult implements ResultInterface
/**
* Create new result
*
* @param string|null $message
* @param string $message
* @param mixed|null $data
*/
public function __construct($message = null, $data = null)
public function __construct($message = '', $data = null)
{
if ($message !== null) {
$this->setMessage($message);
}
$this->setMessage($message);

if ($data !== null) {
$this->setData($data);
Expand Down Expand Up @@ -68,7 +66,7 @@ public function setData($data)
}

/**
* @param null|string $message
* @param string $message
*/
public function setMessage($message)
{
Expand Down

0 comments on commit 527d380

Please sign in to comment.