Skip to content

Commit

Permalink
Merge pull request #29173 from jrebs/hourly-at-arrays
Browse files Browse the repository at this point in the history
[5.8] Allow hourlyAt() to accept array of integers
  • Loading branch information
taylorotwell authored Jul 15, 2019
2 parents ec6bf0a + 084546d commit e74508e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Console/Scheduling/ManagesFrequencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@ public function hourly()
/**
* Schedule the event to run hourly at a given offset in the hour.
*
* @param int $offset
* @param array|int $offset
* @return $this
*/
public function hourlyAt($offset)
{
$offset = is_array($offset) ? implode(',', $offset) : $offset;

return $this->spliceIntoPosition(1, $offset);
}

Expand Down
1 change: 1 addition & 0 deletions tests/Console/Scheduling/FrequencyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function testOverrideWithHourly()
{
$this->assertEquals('0 * * * *', $this->event->everyFiveMinutes()->hourly()->getExpression());
$this->assertEquals('37 * * * *', $this->event->hourlyAt(37)->getExpression());
$this->assertEquals('15,30,45 * * * *', $this->event->hourlyAt([15, 30, 45])->getExpression());
}

public function testMonthlyOn()
Expand Down

0 comments on commit e74508e

Please sign in to comment.