Skip to content

Commit

Permalink
[Converter] Updated conversion making it more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
popy-dev committed Mar 6, 2018
1 parent 8b290e6 commit 6662e50
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Converter/Conversion.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Conversion
* conversion from unix time, and an eventually completed copy of the
* source date.
*
* @var DateRepresentationInterface|null
* @var DateRepresentationInterface
*/
protected $to;

Expand All @@ -46,7 +46,7 @@ class Conversion
public function __construct(DateRepresentationInterface $from, DateRepresentationInterface $to = null)
{
$this->from = $from;
$this->to = $to;
$this->to = $to ?: $from;
$this->unixTime = $from->getUnixTime();
$this->unixMicroTime = $from->getUnixMicroTime();
}
Expand All @@ -64,7 +64,7 @@ public function getFrom()
/**
* Gets the Converted date.
*
* @return DateRepresentationInterface|null
* @return DateRepresentationInterface
*/
public function getTo()
{
Expand Down

0 comments on commit 6662e50

Please sign in to comment.