Skip to content

Commit

Permalink
Add PHPDoc type hints (#53984)
Browse files Browse the repository at this point in the history
* Add PHPDoc type hints

* Hours are 0-based

* Fix spacing
  • Loading branch information
shaedrich authored Dec 19, 2024
1 parent 5744f80 commit 6797f03
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
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')
* @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

0 comments on commit 6797f03

Please sign in to comment.