You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. namespace Illuminate\Support\Facades;
  3. use Illuminate\Support\DateFactory;
  4. /**
  5. * @see https://carbon.nesbot.com/docs/
  6. * @see https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Factory.php
  7. *
  8. * @method static \Illuminate\Support\Carbon create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null)
  9. * @method static \Illuminate\Support\Carbon createFromDate($year = null, $month = null, $day = null, $tz = null)
  10. * @method static \Illuminate\Support\Carbon|false createFromFormat($format, $time, $tz = null)
  11. * @method static \Illuminate\Support\Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null)
  12. * @method static \Illuminate\Support\Carbon createFromTimeString($time, $tz = null)
  13. * @method static \Illuminate\Support\Carbon createFromTimestamp($timestamp, $tz = null)
  14. * @method static \Illuminate\Support\Carbon createFromTimestampMs($timestamp, $tz = null)
  15. * @method static \Illuminate\Support\Carbon createFromTimestampUTC($timestamp)
  16. * @method static \Illuminate\Support\Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null)
  17. * @method static \Illuminate\Support\Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
  18. * @method static \Illuminate\Support\Carbon disableHumanDiffOption($humanDiffOption)
  19. * @method static \Illuminate\Support\Carbon enableHumanDiffOption($humanDiffOption)
  20. * @method static mixed executeWithLocale($locale, $func)
  21. * @method static \Illuminate\Support\Carbon fromSerialized($value)
  22. * @method static array getAvailableLocales()
  23. * @method static array getDays()
  24. * @method static int getHumanDiffOptions()
  25. * @method static array getIsoUnits()
  26. * @method static \Illuminate\Support\Carbon getLastErrors()
  27. * @method static string getLocale()
  28. * @method static int getMidDayAt()
  29. * @method static \Illuminate\Support\Carbon getTestNow()
  30. * @method static \Symfony\Component\Translation\TranslatorInterface getTranslator()
  31. * @method static int getWeekEndsAt()
  32. * @method static int getWeekStartsAt()
  33. * @method static array getWeekendDays()
  34. * @method static bool hasFormat($date, $format)
  35. * @method static bool hasMacro($name)
  36. * @method static bool hasRelativeKeywords($time)
  37. * @method static bool hasTestNow()
  38. * @method static \Illuminate\Support\Carbon instance($date)
  39. * @method static bool isImmutable()
  40. * @method static bool isModifiableUnit($unit)
  41. * @method static \Illuminate\Support\Carbon isMutable()
  42. * @method static bool isStrictModeEnabled()
  43. * @method static bool localeHasDiffOneDayWords($locale)
  44. * @method static bool localeHasDiffSyntax($locale)
  45. * @method static bool localeHasDiffTwoDayWords($locale)
  46. * @method static bool localeHasPeriodSyntax($locale)
  47. * @method static bool localeHasShortUnits($locale)
  48. * @method static void macro($name, $macro)
  49. * @method static \Illuminate\Support\Carbon|null make($var)
  50. * @method static \Illuminate\Support\Carbon maxValue()
  51. * @method static \Illuminate\Support\Carbon minValue()
  52. * @method static void mixin($mixin)
  53. * @method static \Illuminate\Support\Carbon now($tz = null)
  54. * @method static \Illuminate\Support\Carbon parse($time = null, $tz = null)
  55. * @method static string pluralUnit(string $unit)
  56. * @method static void resetMonthsOverflow()
  57. * @method static void resetToStringFormat()
  58. * @method static void resetYearsOverflow()
  59. * @method static void serializeUsing($callback)
  60. * @method static \Illuminate\Support\Carbon setHumanDiffOptions($humanDiffOptions)
  61. * @method static bool setLocale($locale)
  62. * @method static void setMidDayAt($hour)
  63. * @method static \Illuminate\Support\Carbon setTestNow($testNow = null)
  64. * @method static void setToStringFormat($format)
  65. * @method static void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator)
  66. * @method static \Illuminate\Support\Carbon setUtf8($utf8)
  67. * @method static void setWeekEndsAt($day)
  68. * @method static void setWeekStartsAt($day)
  69. * @method static void setWeekendDays($days)
  70. * @method static bool shouldOverflowMonths()
  71. * @method static bool shouldOverflowYears()
  72. * @method static string singularUnit(string $unit)
  73. * @method static \Illuminate\Support\Carbon today($tz = null)
  74. * @method static \Illuminate\Support\Carbon tomorrow($tz = null)
  75. * @method static void useMonthsOverflow($monthsOverflow = true)
  76. * @method static \Illuminate\Support\Carbon useStrictMode($strictModeEnabled = true)
  77. * @method static void useYearsOverflow($yearsOverflow = true)
  78. * @method static \Illuminate\Support\Carbon yesterday($tz = null)
  79. */
  80. class Date extends Facade
  81. {
  82. const DEFAULT_FACADE = DateFactory::class;
  83. /**
  84. * Get the registered name of the component.
  85. *
  86. * @return string
  87. *
  88. * @throws \RuntimeException
  89. */
  90. protected static function getFacadeAccessor()
  91. {
  92. return 'date';
  93. }
  94. /**
  95. * Resolve the facade root instance from the container.
  96. *
  97. * @param string $name
  98. * @return mixed
  99. */
  100. protected static function resolveFacadeInstance($name)
  101. {
  102. if (! isset(static::$resolvedInstance[$name]) && ! isset(static::$app, static::$app[$name])) {
  103. $class = static::DEFAULT_FACADE;
  104. static::swap(new $class);
  105. }
  106. return parent::resolveFacadeInstance($name);
  107. }
  108. }