Skip to content

Commit 6797f03

Browse files
authored
Add PHPDoc type hints (#53984)
* Add PHPDoc type hints * Hours are 0-based * Fix spacing
1 parent 5744f80 commit 6797f03

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/Illuminate/Console/Scheduling/ManagesFrequencies.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public function everyThirtySeconds()
143143
/**
144144
* Schedule the event to run multiple times per minute.
145145
*
146-
* @param int $seconds
146+
* @param int<0, 59> $seconds
147147
* @return $this
148148
*/
149149
protected function repeatEvery($seconds)
@@ -250,7 +250,7 @@ public function hourly()
250250
/**
251251
* Schedule the event to run hourly at a given offset in the hour.
252252
*
253-
* @param array|string|int $offset
253+
* @param array|string|int<0, 23>|int<0, 23>[] $offset
254254
* @return $this
255255
*/
256256
public function hourlyAt($offset)
@@ -353,8 +353,8 @@ public function dailyAt($time)
353353
/**
354354
* Schedule the event to run twice daily.
355355
*
356-
* @param int $first
357-
* @param int $second
356+
* @param int<0, 23> $first
357+
* @param int<0, 23> $second
358358
* @return $this
359359
*/
360360
public function twiceDaily($first = 1, $second = 13)
@@ -365,9 +365,9 @@ public function twiceDaily($first = 1, $second = 13)
365365
/**
366366
* Schedule the event to run twice daily at a given offset.
367367
*
368-
* @param int $first
369-
* @param int $second
370-
* @param int $offset
368+
* @param int<0, 23> $first
369+
* @param int<0, 23> $second
370+
* @param int<0, 59> $offset
371371
* @return $this
372372
*/
373373
public function twiceDailyAt($first = 1, $second = 13, $offset = 0)
@@ -380,8 +380,8 @@ public function twiceDailyAt($first = 1, $second = 13, $offset = 0)
380380
/**
381381
* Schedule the event to run at the given minutes and hours.
382382
*
383-
* @param array|string|int $minutes
384-
* @param array|string|int $hours
383+
* @param array|string|int<0, 59> $minutes
384+
* @param array|string|int<0, 23> $hours
385385
* @return $this
386386
*/
387387
protected function hourBasedSchedule($minutes, $hours)
@@ -525,7 +525,7 @@ public function monthly()
525525
/**
526526
* Schedule the event to run monthly on a given day and time.
527527
*
528-
* @param int $dayOfMonth
528+
* @param int<0, 31> $dayOfMonth
529529
* @param string $time
530530
* @return $this
531531
*/
@@ -539,8 +539,8 @@ public function monthlyOn($dayOfMonth = 1, $time = '0:0')
539539
/**
540540
* Schedule the event to run twice monthly at a given time.
541541
*
542-
* @param int $first
543-
* @param int $second
542+
* @param int $first<0, 31>
543+
* @param int $second<0, 31>
544544
* @param string $time
545545
* @return $this
546546
*/
@@ -611,7 +611,7 @@ public function yearly()
611611
* Schedule the event to run yearly on a given month, day, and time.
612612
*
613613
* @param int $month
614-
* @param int|string $dayOfMonth
614+
* @param int<0, 31>|string $dayOfMonth
615615
* @param string $time
616616
* @return $this
617617
*/

src/Illuminate/Support/Facades/Schedule.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes everyFifteenMinutes()
5151
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes everyThirtyMinutes()
5252
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes hourly()
53-
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes hourlyAt(array|string|int $offset)
53+
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes hourlyAt(array|string|int<0, 23> $offset)
5454
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes everyOddHour(array|string|int $offset = 0)
5555
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes everyTwoHours(array|string|int $offset = 0)
5656
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes everyThreeHours(array|string|int $offset = 0)
@@ -59,8 +59,8 @@
5959
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes daily()
6060
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes at(string $time)
6161
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes dailyAt(string $time)
62-
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes twiceDaily(int $first = 1, int $second = 13)
63-
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes twiceDailyAt(int $first = 1, int $second = 13, int $offset = 0)
62+
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes twiceDaily(int<0, 23> $first = 1, int<0, 23> $second = 13)
63+
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes twiceDailyAt(int<0, 23> $first = 1, int<0, 23> $second = 13, int $offset = 0)
6464
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes weekdays()
6565
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes weekends()
6666
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes mondays()
@@ -73,13 +73,13 @@
7373
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes weekly()
7474
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes weeklyOn(array|mixed $dayOfWeek, string $time = '0:0')
7575
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes monthly()
76-
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes monthlyOn(int $dayOfMonth = 1, string $time = '0:0')
77-
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes twiceMonthly(int $first = 1, int $second = 16, string $time = '0:0')
76+
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes monthlyOn(int<0, 31> $dayOfMonth = 1, string $time = '0:0')
77+
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes twiceMonthly(int<0, 31> $first = 1, int<0, 31> $second = 16, string $time = '0:0')
7878
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes lastDayOfMonth(string $time = '0:0')
7979
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes quarterly()
8080
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes quarterlyOn(int $dayOfQuarter = 1, string $time = '0:0')
8181
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes yearly()
82-
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes yearlyOn(int $month = 1, int|string $dayOfMonth = 1, string $time = '0:0')
82+
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes yearlyOn(int $month = 1, int<0, 31>|string $dayOfMonth = 1, string $time = '0:0')
8383
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes days(array|mixed $days)
8484
* @method static \Illuminate\Console\Scheduling\PendingEventAttributes timezone(\DateTimeZone|string $timezone)
8585
*

0 commit comments

Comments
 (0)