Skip to content

Commit

Permalink
Using setter in constructor for setting expiresTimestamp value
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyennv committed Aug 12, 2016
1 parent 22aed6a commit 34bea4c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Zimbra/Account/Struct/PreAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public function __construct($timestamp, $value = null, $expiresTimestamp = null)
{
parent::__construct(trim($value));
$this->setTimestamp($timestamp);
$expiresTimestamp = (int) $expiresTimestamp < 0 ? 0 : (int) $expiresTimestamp;
$this->setProperty('expiresTimestamp', $expiresTimestamp);
$this->setExpiresTimestamp($expiresTimestamp);
}

/**
Expand Down Expand Up @@ -80,7 +79,7 @@ public function getExpiresTimestamp()
public function setExpiresTimestamp($expiresTimestamp)
{
$expiresTimestamp = (int) $expiresTimestamp < 0 ? 0 : (int) $expiresTimestamp;
return $this->setProperty('expiresTimestamp', (int) $expiresTimestamp);
return $this->setProperty('expiresTimestamp', $expiresTimestamp);
}

/**
Expand Down

0 comments on commit 34bea4c

Please sign in to comment.