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

Add PHPDoc type hints #53984

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/Illuminate/Console/Scheduling/ManagesFrequencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function everyThirtySeconds()
/**
* Schedule the event to run multiple times per minute.
*
* @param int $seconds
* @param int<0, 59> $seconds
* @return $this
*/
protected function repeatEvery($seconds)
Expand Down Expand Up @@ -250,7 +250,7 @@ public function hourly()
/**
* Schedule the event to run hourly at a given offset in the hour.
*
* @param array|string|int $offset
* @param array|string|int<0, 23>|int<0, 23>[] $offset
* @return $this
*/
public function hourlyAt($offset)
Expand Down Expand Up @@ -353,8 +353,8 @@ public function dailyAt($time)
/**
* Schedule the event to run twice daily.
*
* @param int $first
* @param int $second
* @param int<0, 23> $first
* @param int<0, 23> $second
* @return $this
*/
public function twiceDaily($first = 1, $second = 13)
Expand All @@ -365,9 +365,9 @@ public function twiceDaily($first = 1, $second = 13)
/**
* Schedule the event to run twice daily at a given offset.
*
* @param int $first
* @param int $second
* @param int $offset
* @param int<0, 23> $first
* @param int<0, 23> $second
* @param int<0, 59> $offset
* @return $this
*/
public function twiceDailyAt($first = 1, $second = 13, $offset = 0)
Expand All @@ -380,8 +380,8 @@ public function twiceDailyAt($first = 1, $second = 13, $offset = 0)
/**
* Schedule the event to run at the given minutes and hours.
*
* @param array|string|int $minutes
* @param array|string|int $hours
* @param array|string|int<0, 59> $minutes
* @param array|string|int<0, 23> $hours
* @return $this
*/
protected function hourBasedSchedule($minutes, $hours)
Expand Down Expand Up @@ -525,7 +525,7 @@ public function monthly()
/**
* Schedule the event to run monthly on a given day and time.
*
* @param int $dayOfMonth
* @param int<0, 31> $dayOfMonth
* @param string $time
* @return $this
*/
Expand All @@ -539,8 +539,8 @@ public function monthlyOn($dayOfMonth = 1, $time = '0:0')
/**
* Schedule the event to run twice monthly at a given time.
*
* @param int $first
* @param int $second
* @param int $first<0, 31>
* @param int $second<0, 31>
* @param string $time
* @return $this
*/
Expand Down Expand Up @@ -611,7 +611,7 @@ public function yearly()
* Schedule the event to run yearly on a given month, day, and time.
*
* @param int $month
* @param int|string $dayOfMonth
* @param int<0, 31>|string $dayOfMonth
* @param string $time
* @return $this
*/
Expand Down
12 changes: 6 additions & 6 deletions src/Illuminate/Support/Facades/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes everyFifteenMinutes()
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes everyThirtyMinutes()
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes hourly()
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes hourlyAt(array|string|int $offset)
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes hourlyAt(array|string|int<0, 23> $offset)
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes everyOddHour(array|string|int $offset = 0)
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes everyTwoHours(array|string|int $offset = 0)
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes everyThreeHours(array|string|int $offset = 0)
Expand All @@ -59,8 +59,8 @@
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes daily()
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes at(string $time)
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes dailyAt(string $time)
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes twiceDaily(int $first = 1, int $second = 13)
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes twiceDailyAt(int $first = 1, int $second = 13, int $offset = 0)
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes twiceDaily(int<0, 23> $first = 1, int<0, 23> $second = 13)
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes twiceDailyAt(int<0, 23> $first = 1, int<0, 23> $second = 13, int $offset = 0)
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes weekdays()
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes weekends()
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes mondays()
Expand All @@ -73,13 +73,13 @@
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes weekly()
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes weeklyOn(array|mixed $dayOfWeek, string $time = '0:0')
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes monthly()
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes monthlyOn(int $dayOfMonth = 1, string $time = '0:0')
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes twiceMonthly(int $first = 1, int $second = 16, string $time = '0:0')
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes monthlyOn(int<0, 31> $dayOfMonth = 1, string $time = '0:0')
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes twiceMonthly(int<0, 31> $first = 1, int<0, 31> $second = 16, string $time = '0:0')
Comment on lines -76 to +77
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a zero based month index, should the range be 1-31? Or does 0 do something special here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, you are right 👍🏻 My bad 🤦🏻 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll send a fix.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* @method static \Illuminate\Console\Scheduling\PendingEventAttributes lastDayOfMonth(string $time = '0:0')
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes quarterly()
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes quarterlyOn(int $dayOfQuarter = 1, string $time = '0:0')
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes yearly()
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes yearlyOn(int $month = 1, int|string $dayOfMonth = 1, string $time = '0:0')
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes yearlyOn(int $month = 1, int<0, 31>|string $dayOfMonth = 1, string $time = '0:0')
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes days(array|mixed $days)
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes timezone(\DateTimeZone|string $timezone)
*
Expand Down