Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jul 17, 2017
1 parent 42fc23b commit 92e2aff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Illuminate/Queue/InteractsWithTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ trait InteractsWithTime
*/
protected function secondsUntil($delay)
{
$delay = $this->handlesInterval($delay);
$delay = $this->parseDateInterval($delay);

return $delay instanceof DateTimeInterface
? max(0, $delay->getTimestamp() - $this->currentTime())
Expand All @@ -32,20 +32,20 @@ protected function secondsUntil($delay)
*/
protected function availableAt($delay = 0)
{
$delay = $this->handlesInterval($delay);
$delay = $this->parseDateInterval($delay);

return $delay instanceof DateTimeInterface
? $delay->getTimestamp()
: Carbon::now()->addSeconds($delay)->getTimestamp();
}

/**
* Converts an interval to a DateTime instance.
* If the given value is an interval, convert it to a DateTime instance.
*
* @param \DateTimeInterface|\DateInterval|int
* @return \DateTime
*/
protected function handlesInterval($delay)
protected function parseDateInterval($delay)
{
if ($delay instanceof DateInterval) {
$delay = (new DateTime)->add($delay);
Expand Down

0 comments on commit 92e2aff

Please sign in to comment.