Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.8] Allow hourlyAt() to accept array of integers #29173

Merged
merged 3 commits into from
Jul 15, 2019
Merged

[5.8] Allow hourlyAt() to accept array of integers #29173

merged 3 commits into from
Jul 15, 2019

Conversation

jrebs
Copy link
Contributor

@jrebs jrebs commented Jul 15, 2019

This small PR expands the functionality of the ManagesFrequencies::hourlyAt() method to allow it to accept an array of integers instead of only a single integer. FrequencyTest class includes passing test for this addition.

This is a non-breaking enhancement because the hourlyAt() method does not typehint the offset value being passed in.

Benefit to users: finer control over granular execution schedules. The hourlyAt() method is not chainable, so in the follow example, the command would only be executed at the 45th minute:

$schedule->command('my:command')->hourlyAt(15)->hourlyAt(30)->hourlyAt(45)

With this PR, it is possible to declare whatever hourly granularity is needed for your use case:

$schedule->command(my:command')->hourlyAt([15, 30, 45]);

@jrebs jrebs changed the title Allow hourlyAt() to accept array of integers [5.8] Allow hourlyAt() to accept array of integers Jul 15, 2019
@taylorotwell taylorotwell merged commit e74508e into laravel:5.8 Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants