Skip to content

[12.x] Update DateFactory method annotations for Carbon v3 compatibility #55151

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

Merged
Merged
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
83 changes: 51 additions & 32 deletions src/Illuminate/Support/DateFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,77 +9,96 @@
* @see https://carbon.nesbot.com/docs/
* @see https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Factory.php
*
* @method \Illuminate\Support\Carbon create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null)
* @method bool canBeCreatedFromFormat(?string $date, string $format)
* @method \Illuminate\Support\Carbon|null create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null)
* @method \Illuminate\Support\Carbon createFromDate($year = null, $month = null, $day = null, $timezone = null)
* @method \Illuminate\Support\Carbon|false createFromFormat($format, $time, $timezone = null)
* @method \Illuminate\Support\Carbon|null createFromFormat($format, $time, $timezone = null)
* @method \Illuminate\Support\Carbon|null createFromIsoFormat(string $format, string $time, $timezone = null, ?string $locale = 'en', ?TranslatorInterface $translator = null)
* @method \Illuminate\Support\Carbon|null createFromLocaleFormat(string $format, string $locale, string $time, $timezone = null)
* @method \Illuminate\Support\Carbon|null createFromLocaleIsoFormat(string $format, string $locale, string $time, $timezone = null)
* @method \Illuminate\Support\Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $timezone = null)
* @method \Illuminate\Support\Carbon createFromTimeString($time, $timezone = null)
* @method \Illuminate\Support\Carbon createFromTimestamp($timestamp, $timezone = null)
* @method \Illuminate\Support\Carbon createFromTimestampMs($timestamp, $timezone = null)
* @method \Illuminate\Support\Carbon createFromTimestampUTC($timestamp)
* @method \Illuminate\Support\Carbon createFromTimeString(string $time, DateTimeZone|string|int|null $timezone = null)
* @method \Illuminate\Support\Carbon createFromTimestamp(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null)
* @method \Illuminate\Support\Carbon createFromTimestampMs(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null)
* @method \Illuminate\Support\Carbon createFromTimestampMsUTC($timestamp)
* @method \Illuminate\Support\Carbon createFromTimestampUTC(string|int|float $timestamp)
* @method \Illuminate\Support\Carbon createMidnightDate($year = null, $month = null, $day = null, $timezone = null)
* @method \Illuminate\Support\Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null)
* @method \Illuminate\Support\Carbon|null createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null)
* @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)
* @method void disableHumanDiffOption($humanDiffOption)
* @method void enableHumanDiffOption($humanDiffOption)
* @method mixed executeWithLocale($locale, $func)
* @method mixed executeWithLocale(string $locale, callable $func)
* @method \Illuminate\Support\Carbon fromSerialized($value)
* @method array getAvailableLocales()
* @method array getAvailableLocalesInfo()
* @method array getDays()
* @method ?string getFallbackLocale()
* @method array getFormatsToIsoReplacements()
* @method int getHumanDiffOptions()
* @method array getIsoUnits()
* @method array getLastErrors()
* @method array|false getLastErrors()
* @method string getLocale()
* @method int getMidDayAt()
* @method string getTimeFormatByPrecision(string $unitPrecision)
* @method string|Closure|null getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null)
* @method \Illuminate\Support\Carbon|null getTestNow()
* @method \Symfony\Contracts\Translation\TranslatorInterface getTranslator()
* @method int getWeekEndsAt()
* @method int getWeekStartsAt()
* @method int getWeekEndsAt(?string $locale = null)
* @method int getWeekStartsAt(?string $locale = null)
* @method array getWeekendDays()
* @method bool hasFormat($date, $format)
* @method bool hasFormat(string $date, string $format)
* @method bool hasFormatWithModifiers(string $date, string $format)
* @method bool hasMacro($name)
* @method bool hasRelativeKeywords($time)
* @method bool hasRelativeKeywords(?string $time)
* @method bool hasTestNow()
* @method \Illuminate\Support\Carbon instance($date)
* @method \Illuminate\Support\Carbon instance(DateTimeInterface $date)
* @method bool isImmutable()
* @method bool isModifiableUnit($unit)
* @method bool isMutable()
* @method bool isStrictModeEnabled()
* @method bool localeHasDiffOneDayWords($locale)
* @method bool localeHasDiffSyntax($locale)
* @method bool localeHasDiffTwoDayWords($locale)
* @method bool localeHasDiffOneDayWords(string $locale)
* @method bool localeHasDiffSyntax(string $locale)
* @method bool localeHasDiffTwoDayWords(string $locale)
* @method bool localeHasPeriodSyntax($locale)
* @method bool localeHasShortUnits($locale)
* @method void macro($name, $macro)
* @method \Illuminate\Support\Carbon|null make($var)
* @method \Illuminate\Support\Carbon maxValue()
* @method \Illuminate\Support\Carbon minValue()
* @method void mixin($mixin)
* @method \Illuminate\Support\Carbon now($timezone = null)
* @method \Illuminate\Support\Carbon parse($time = null, $timezone = null)
* @method bool localeHasShortUnits(string $locale)
* @method void macro(string $name, ?callable $macro)
* @method \Illuminate\Support\Carbon|null make($var, DateTimeZone|string|null $timezone = null)
* @method void mixin(object|string $mixin)
* @method \Illuminate\Support\Carbon now(DateTimeZone|string|int|null $timezone = null)
* @method \Illuminate\Support\Carbon parse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null)
* @method \Illuminate\Support\Carbon parseFromLocale(string $time, ?string $locale = null, DateTimeZone|string|int|null $timezone = null)
* @method string pluralUnit(string $unit)
* @method \Illuminate\Support\Carbon|null rawCreateFromFormat(string $format, string $time, $timezone = null)
* @method \Illuminate\Support\Carbon rawParse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null)
* @method void resetMonthsOverflow()
* @method void resetToStringFormat()
* @method void resetYearsOverflow()
* @method void serializeUsing($callback)
* @method void setFallbackLocale(string $locale)
* @method void setHumanDiffOptions($humanDiffOptions)
* @method bool setLocale($locale)
* @method void setLocale(string $locale)
* @method void setMidDayAt($hour)
* @method void setTestNow($testNow = null)
* @method void setToStringFormat($format)
* @method void setTestNow(mixed $testNow = null)
* @method void setTestNowAndTimezone(mixed $testNow = null, $timezone = null)
* @method void setToStringFormat(string|Closure|null $format)
* @method void setTranslator(\Symfony\Contracts\Translation\TranslatorInterface $translator)
* @method void setUtf8($utf8)
* @method void setWeekEndsAt($day)
* @method void setWeekStartsAt($day)
* @method void setWeekendDays($days)
* @method bool shouldOverflowMonths()
* @method bool shouldOverflowYears()
* @method string singularUnit(string $unit)
* @method \Illuminate\Support\Carbon today($timezone = null)
* @method \Illuminate\Support\Carbon tomorrow($timezone = null)
* @method void sleep(int|float $seconds)
* @method \Illuminate\Support\Carbon today(DateTimeZone|string|int|null $timezone = null)
* @method \Illuminate\Support\Carbon tomorrow(DateTimeZone|string|int|null $timezone = null)
* @method string translateTimeString(string $timeString, ?string $from = null, ?string $to = null, int $mode = CarbonInterface::TRANSLATE_ALL)
* @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null)
* @method void useMonthsOverflow($monthsOverflow = true)
* @method void useStrictMode($strictModeEnabled = true)
* @method void useYearsOverflow($yearsOverflow = true)
* @method \Illuminate\Support\Carbon yesterday($timezone = null)
* @method mixed withTestNow(mixed $testNow, callable $callback)
* @method static withTimeZone(DateTimeZone|string|int|null $timezone)
* @method \Illuminate\Support\Carbon yesterday(DateTimeZone|string|int|null $timezone = null)
*/
class DateFactory
{
Expand Down
Loading