Skip to content

Commit 964c4bb

Browse files
authored
Update DateFactory method annotations for Carbon v3 compatibility (#55151)
1 parent dd16215 commit 964c4bb

File tree

1 file changed

+51
-32
lines changed

1 file changed

+51
-32
lines changed

src/Illuminate/Support/DateFactory.php

Lines changed: 51 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,77 +9,96 @@
99
* @see https://carbon.nesbot.com/docs/
1010
* @see https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Factory.php
1111
*
12-
* @method \Illuminate\Support\Carbon create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null)
12+
* @method bool canBeCreatedFromFormat(?string $date, string $format)
13+
* @method \Illuminate\Support\Carbon|null create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null)
1314
* @method \Illuminate\Support\Carbon createFromDate($year = null, $month = null, $day = null, $timezone = null)
14-
* @method \Illuminate\Support\Carbon|false createFromFormat($format, $time, $timezone = null)
15+
* @method \Illuminate\Support\Carbon|null createFromFormat($format, $time, $timezone = null)
16+
* @method \Illuminate\Support\Carbon|null createFromIsoFormat(string $format, string $time, $timezone = null, ?string $locale = 'en', ?TranslatorInterface $translator = null)
17+
* @method \Illuminate\Support\Carbon|null createFromLocaleFormat(string $format, string $locale, string $time, $timezone = null)
18+
* @method \Illuminate\Support\Carbon|null createFromLocaleIsoFormat(string $format, string $locale, string $time, $timezone = null)
1519
* @method \Illuminate\Support\Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $timezone = null)
16-
* @method \Illuminate\Support\Carbon createFromTimeString($time, $timezone = null)
17-
* @method \Illuminate\Support\Carbon createFromTimestamp($timestamp, $timezone = null)
18-
* @method \Illuminate\Support\Carbon createFromTimestampMs($timestamp, $timezone = null)
19-
* @method \Illuminate\Support\Carbon createFromTimestampUTC($timestamp)
20+
* @method \Illuminate\Support\Carbon createFromTimeString(string $time, DateTimeZone|string|int|null $timezone = null)
21+
* @method \Illuminate\Support\Carbon createFromTimestamp(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null)
22+
* @method \Illuminate\Support\Carbon createFromTimestampMs(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null)
23+
* @method \Illuminate\Support\Carbon createFromTimestampMsUTC($timestamp)
24+
* @method \Illuminate\Support\Carbon createFromTimestampUTC(string|int|float $timestamp)
2025
* @method \Illuminate\Support\Carbon createMidnightDate($year = null, $month = null, $day = null, $timezone = null)
21-
* @method \Illuminate\Support\Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null)
26+
* @method \Illuminate\Support\Carbon|null createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null)
27+
* @method \Illuminate\Support\Carbon createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $timezone = null)
2228
* @method void disableHumanDiffOption($humanDiffOption)
2329
* @method void enableHumanDiffOption($humanDiffOption)
24-
* @method mixed executeWithLocale($locale, $func)
30+
* @method mixed executeWithLocale(string $locale, callable $func)
2531
* @method \Illuminate\Support\Carbon fromSerialized($value)
2632
* @method array getAvailableLocales()
33+
* @method array getAvailableLocalesInfo()
2734
* @method array getDays()
35+
* @method ?string getFallbackLocale()
36+
* @method array getFormatsToIsoReplacements()
2837
* @method int getHumanDiffOptions()
2938
* @method array getIsoUnits()
30-
* @method array getLastErrors()
39+
* @method array|false getLastErrors()
3140
* @method string getLocale()
3241
* @method int getMidDayAt()
42+
* @method string getTimeFormatByPrecision(string $unitPrecision)
43+
* @method string|Closure|null getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null)
3344
* @method \Illuminate\Support\Carbon|null getTestNow()
3445
* @method \Symfony\Contracts\Translation\TranslatorInterface getTranslator()
35-
* @method int getWeekEndsAt()
36-
* @method int getWeekStartsAt()
46+
* @method int getWeekEndsAt(?string $locale = null)
47+
* @method int getWeekStartsAt(?string $locale = null)
3748
* @method array getWeekendDays()
38-
* @method bool hasFormat($date, $format)
49+
* @method bool hasFormat(string $date, string $format)
50+
* @method bool hasFormatWithModifiers(string $date, string $format)
3951
* @method bool hasMacro($name)
40-
* @method bool hasRelativeKeywords($time)
52+
* @method bool hasRelativeKeywords(?string $time)
4153
* @method bool hasTestNow()
42-
* @method \Illuminate\Support\Carbon instance($date)
54+
* @method \Illuminate\Support\Carbon instance(DateTimeInterface $date)
4355
* @method bool isImmutable()
4456
* @method bool isModifiableUnit($unit)
4557
* @method bool isMutable()
4658
* @method bool isStrictModeEnabled()
47-
* @method bool localeHasDiffOneDayWords($locale)
48-
* @method bool localeHasDiffSyntax($locale)
49-
* @method bool localeHasDiffTwoDayWords($locale)
59+
* @method bool localeHasDiffOneDayWords(string $locale)
60+
* @method bool localeHasDiffSyntax(string $locale)
61+
* @method bool localeHasDiffTwoDayWords(string $locale)
5062
* @method bool localeHasPeriodSyntax($locale)
51-
* @method bool localeHasShortUnits($locale)
52-
* @method void macro($name, $macro)
53-
* @method \Illuminate\Support\Carbon|null make($var)
54-
* @method \Illuminate\Support\Carbon maxValue()
55-
* @method \Illuminate\Support\Carbon minValue()
56-
* @method void mixin($mixin)
57-
* @method \Illuminate\Support\Carbon now($timezone = null)
58-
* @method \Illuminate\Support\Carbon parse($time = null, $timezone = null)
63+
* @method bool localeHasShortUnits(string $locale)
64+
* @method void macro(string $name, ?callable $macro)
65+
* @method \Illuminate\Support\Carbon|null make($var, DateTimeZone|string|null $timezone = null)
66+
* @method void mixin(object|string $mixin)
67+
* @method \Illuminate\Support\Carbon now(DateTimeZone|string|int|null $timezone = null)
68+
* @method \Illuminate\Support\Carbon parse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null)
69+
* @method \Illuminate\Support\Carbon parseFromLocale(string $time, ?string $locale = null, DateTimeZone|string|int|null $timezone = null)
5970
* @method string pluralUnit(string $unit)
71+
* @method \Illuminate\Support\Carbon|null rawCreateFromFormat(string $format, string $time, $timezone = null)
72+
* @method \Illuminate\Support\Carbon rawParse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null)
6073
* @method void resetMonthsOverflow()
6174
* @method void resetToStringFormat()
6275
* @method void resetYearsOverflow()
6376
* @method void serializeUsing($callback)
77+
* @method void setFallbackLocale(string $locale)
6478
* @method void setHumanDiffOptions($humanDiffOptions)
65-
* @method bool setLocale($locale)
79+
* @method void setLocale(string $locale)
6680
* @method void setMidDayAt($hour)
67-
* @method void setTestNow($testNow = null)
68-
* @method void setToStringFormat($format)
81+
* @method void setTestNow(mixed $testNow = null)
82+
* @method void setTestNowAndTimezone(mixed $testNow = null, $timezone = null)
83+
* @method void setToStringFormat(string|Closure|null $format)
6984
* @method void setTranslator(\Symfony\Contracts\Translation\TranslatorInterface $translator)
70-
* @method void setUtf8($utf8)
7185
* @method void setWeekEndsAt($day)
7286
* @method void setWeekStartsAt($day)
7387
* @method void setWeekendDays($days)
7488
* @method bool shouldOverflowMonths()
7589
* @method bool shouldOverflowYears()
7690
* @method string singularUnit(string $unit)
77-
* @method \Illuminate\Support\Carbon today($timezone = null)
78-
* @method \Illuminate\Support\Carbon tomorrow($timezone = null)
91+
* @method void sleep(int|float $seconds)
92+
* @method \Illuminate\Support\Carbon today(DateTimeZone|string|int|null $timezone = null)
93+
* @method \Illuminate\Support\Carbon tomorrow(DateTimeZone|string|int|null $timezone = null)
94+
* @method string translateTimeString(string $timeString, ?string $from = null, ?string $to = null, int $mode = CarbonInterface::TRANSLATE_ALL)
95+
* @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null)
7996
* @method void useMonthsOverflow($monthsOverflow = true)
8097
* @method void useStrictMode($strictModeEnabled = true)
8198
* @method void useYearsOverflow($yearsOverflow = true)
82-
* @method \Illuminate\Support\Carbon yesterday($timezone = null)
99+
* @method mixed withTestNow(mixed $testNow, callable $callback)
100+
* @method static withTimeZone(DateTimeZone|string|int|null $timezone)
101+
* @method \Illuminate\Support\Carbon yesterday(DateTimeZone|string|int|null $timezone = null)
83102
*/
84103
class DateFactory
85104
{

0 commit comments

Comments
 (0)