From 0dc8d35833b3c7b4bbfafab160317dbeed952480 Mon Sep 17 00:00:00 2001
From: kylekatarnls <5966783+kylekatarnls@users.noreply.github.com>
Date: Thu, 10 Oct 2024 07:08:16 +0000
Subject: [PATCH 1/2] Update documentation
---
docs/index.html | 88 ++++++++++++++++++++++----------------------
reference/index.html | 82 ++++++++++++++++++++---------------------
2 files changed, 85 insertions(+), 85 deletions(-)
diff --git a/docs/index.html b/docs/index.html
index 59effb3c68..ba7ac01486 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -133,13 +133,13 @@
Introduction
$modifiedImmutable = CarbonImmutable::now()->add(1, 'day');
var_dump($modifiedMutable === $mutable); // bool(true)
-var_dump($mutable->isoFormat('dddd D')); // string(11) "Thursday 10"
-var_dump($modifiedMutable->isoFormat('dddd D')); // string(11) "Thursday 10"
+var_dump($mutable->isoFormat('dddd D')); // string(9) "Friday 11"
+var_dump($modifiedMutable->isoFormat('dddd D')); // string(9) "Friday 11"
// So it means $mutable and $modifiedMutable are the same object
// both set to now + 1 day.
var_dump($modifiedImmutable === $immutable); // bool(false)
-var_dump($immutable->isoFormat('dddd D')); // string(11) "Wednesday 9"
-var_dump($modifiedImmutable->isoFormat('dddd D')); // string(11) "Thursday 10"
+var_dump($immutable->isoFormat('dddd D')); // string(11) "Thursday 10"
+var_dump($modifiedImmutable->isoFormat('dddd D')); // string(9) "Friday 11"
// While $immutable is still set to now and cannot be changed and
// $modifiedImmutable is a new instance created from $immutable
// set to now + 1 day.
@@ -281,16 +281,16 @@ Instantiation
$now = Carbon::now();
-echo $now; // 2024-10-09 22:29:15
+echo $now; // 2024-10-10 07:08:15
echo "\n";
$today = Carbon::today();
-echo $today; // 2024-10-09 00:00:00
+echo $today; // 2024-10-10 00:00:00
echo "\n";
$tomorrow = Carbon::tomorrow('Europe/London');
-echo $tomorrow; // 2024-10-10 00:00:00
+echo $tomorrow; // 2024-10-11 00:00:00
echo "\n";
$yesterday = Carbon::yesterday();
-echo $yesterday; // 2024-10-08 00:00:00
+echo $yesterday; // 2024-10-09 00:00:00
@@ -451,7 +451,7 @@ Instantiation
// 19:15 in Johannesburg
echo 'Meeting starts at '.$meeting->format('H:i').' in Johannesburg.'; // Meeting starts at 19:15 in Johannesburg.
// now in Johannesburg
-echo "It's ".$meeting->nowWithSameTz()->format('H:i').' right now in Johannesburg.'; // It's 00:29 right now in Johannesburg.
+echo "It's ".$meeting->nowWithSameTz()->format('H:i').' right now in Johannesburg.'; // It's 09:08 right now in Johannesburg.
@@ -705,7 +705,7 @@ Localization
echo "\n";
echo $date->monthName; // octobre
echo "\n";
-echo $date->isoFormat('LLLL'); // mercredi 9 octobre 2024 22:29
+echo $date->isoFormat('LLLL'); // jeudi 10 octobre 2024 07:08
@@ -736,13 +736,13 @@ Localization
echo $toDisplay;
/*
15 juin 2018 14:34
-Aujourd’hui à 00:29
+Aujourd’hui à 09:08
*/
echo $notificationForJohn;
/*
Jun 15, 2018 7:34 AM
-Today at 5:29 PM
+Today at 2:08 AM
*/
@@ -769,9 +769,9 @@ Localization
]);
// Important note: timezone setting calls ->shiftTimezone() and not ->setTimezone(),
// It means it does not just set the timezone, but shift the time too:
-echo Carbon::today()->setTimezone('Asia/Tokyo')->format('d/m G\h e'); // 09/10 9h Asia/Tokyo
+echo Carbon::today()->setTimezone('Asia/Tokyo')->format('d/m G\h e'); // 10/10 9h Asia/Tokyo
echo "\n";
-echo Carbon::today()->shiftTimezone('Asia/Tokyo')->format('d/m G\h e'); // 09/10 0h Asia/Tokyo
+echo Carbon::today()->shiftTimezone('Asia/Tokyo')->format('d/m G\h e'); // 10/10 0h Asia/Tokyo
// You can find back which factory created a given object:
$a = $factory->now();
@@ -1654,21 +1654,21 @@ Localization
$date = CarbonImmutable::now();
-echo $date->calendar(); // Today at 10:29 PM
+echo $date->calendar(); // Today at 7:08 AM
echo "\n";
-echo $date->sub('1 day 3 hours')->calendar(); // Yesterday at 7:29 PM
+echo $date->sub('1 day 3 hours')->calendar(); // Yesterday at 4:08 AM
echo "\n";
-echo $date->sub('3 days 10 hours 23 minutes')->calendar(); // Last Sunday at 12:06 PM
+echo $date->sub('3 days 10 hours 23 minutes')->calendar(); // Last Sunday at 8:45 PM
echo "\n";
-echo $date->sub('8 days')->calendar(); // 10/01/2024
+echo $date->sub('8 days')->calendar(); // 10/02/2024
echo "\n";
-echo $date->add('1 day 3 hours')->calendar(); // Friday at 1:29 AM
+echo $date->add('1 day 3 hours')->calendar(); // Tomorrow at 10:08 AM
echo "\n";
-echo $date->add('3 days 10 hours 23 minutes')->calendar(); // Sunday at 8:52 AM
+echo $date->add('3 days 10 hours 23 minutes')->calendar(); // Sunday at 5:31 PM
echo "\n";
-echo $date->add('8 days')->calendar(); // 10/17/2024
+echo $date->add('8 days')->calendar(); // 10/18/2024
echo "\n";
-echo $date->locale('fr')->calendar(); // Aujourd’hui à 22:29
+echo $date->locale('fr')->calendar(); // Aujourd’hui à 07:08
@@ -5588,7 +5588,7 @@ Testing Aids
var_dump(Carbon::hasTestNow()); // bool(true)
Carbon::setTestNow(); // clear the mock
var_dump(Carbon::hasTestNow()); // bool(false)
-echo Carbon::now(); // 2024-10-09 22:29:17
+echo Carbon::now(); // 2024-10-10 07:08:15
// Instead of mock and clear mock, you also can use withTestNow():
Carbon::withTestNow('2010-09-15', static function () {
@@ -5786,7 +5786,7 @@ Getters
// Returns timezone as CarbonTimeZone
var_dump(Carbon::createFromTimestamp(0, 'Europe/Paris')->getTimezone());
-/* object(Carbon\CarbonTimeZone)#2700 (3) {
+/* object(Carbon\CarbonTimeZone)#533 (3) {
["clock":"Carbon\CarbonTimeZone":private]=>
NULL
["timezone_type"]=>
@@ -5831,12 +5831,12 @@ Getters
// You can get any property dynamically too:
$unit = 'second';
-var_dump(Carbon::now()->get($unit)); // int(17)
+var_dump(Carbon::now()->get($unit)); // int(15)
// equivalent to:
-var_dump(Carbon::now()->$unit); // int(17)
+var_dump(Carbon::now()->$unit); // int(15)
// If you have plural unit name, use singularUnit()
$unit = Carbon::singularUnit('seconds');
-var_dump(Carbon::now()->get($unit)); // int(17)
+var_dump(Carbon::now()->get($unit)); // int(15)
// Prefer using singularUnit() because some plurals are not the word with S:
var_dump(Carbon::pluralUnit('century')); // string(9) "centuries"
var_dump(Carbon::pluralUnit('millennium')); // string(9) "millennia"
@@ -6176,7 +6176,7 @@ Conversion
["formatted"]=>
string(19) "2019-02-01 03:45:27"
["timezone"]=>
- object(Carbon\CarbonTimeZone)#1092 (3) {
+ object(Carbon\CarbonTimeZone)#1096 (3) {
["clock":"Carbon\CarbonTimeZone":private]=>
NULL
["timezone_type"]=>
@@ -6189,7 +6189,7 @@ Conversion
var_dump($dt->toObject());
/*
-object(stdClass)#1092 (12) {
+object(stdClass)#1096 (12) {
["year"]=>
int(2019)
["month"]=>
@@ -6213,7 +6213,7 @@ Conversion
["formatted"]=>
string(19) "2019-02-01 03:45:27"
["timezone"]=>
- object(Carbon\CarbonTimeZone)#1377 (3) {
+ object(Carbon\CarbonTimeZone)#1093 (3) {
["clock":"Carbon\CarbonTimeZone":private]=>
NULL
["timezone_type"]=>
@@ -6226,7 +6226,7 @@ Conversion
var_dump($dt->toDate()); // Same as $dt->toDateTime()
/*
-object(DateTime)#1092 (3) {
+object(DateTime)#1096 (3) {
["date"]=>
string(26) "2019-02-01 03:45:27.612584"
["timezone_type"]=>
@@ -6240,7 +6240,7 @@ Conversion
// to both DateTime and DateTimeImmutable
var_dump($dt->toDateTimeImmutable());
/*
-object(DateTimeImmutable)#1092 (3) {
+object(DateTimeImmutable)#1096 (3) {
["date"]=>
string(26) "2019-02-01 03:45:27.612584"
["timezone_type"]=>
@@ -6413,8 +6413,8 @@ Comparison
// now is the default param
$dt1 = Carbon::createMidnightDate(2000, 1, 1);
-echo $dt1->max(); // 2024-10-09 22:29:17
-echo $dt1->maximum(); // 2024-10-09 22:29:17
+echo $dt1->max(); // 2024-10-10 07:08:15
+echo $dt1->maximum(); // 2024-10-10 07:08:15
// Remember min and max PHP native function work fine with dates too:
echo max(Carbon::create('2002-03-15'), Carbon::create('2003-01-07'), Carbon::create('2002-08-25')); // 2003-01-07 00:00:00
@@ -6909,7 +6909,7 @@ Difference
greater than the other.
-
echo Carbon::now('America/Vancouver')->diffInSeconds(Carbon::now('Europe/London')); // 9.0E-6
+ echo Carbon::now('America/Vancouver')->diffInSeconds(Carbon::now('Europe/London')); // 5.0E-6
$dtOttawa = Carbon::createMidnightDate(2000, 1, 1, 'America/Toronto');
$dtVancouver = Carbon::createMidnightDate(2000, 1, 1, 'America/Vancouver');
@@ -7048,10 +7048,10 @@ Difference
$date = Carbon::now()->addSeconds(3666);
-echo $date->diffInSeconds(); // -3665.99991
-echo $date->diffInMinutes(); // -61.0999969
-echo $date->diffInHours(); // -1.0183332591667
-echo $date->diffInDays(); // -0.042430551574074
+echo $date->diffInSeconds(); // -3665.999954
+echo $date->diffInMinutes(); // -61.099998533333
+echo $date->diffInHours(); // -1.0183332986111
+echo $date->diffInDays(); // -0.042430553668981
$date = Carbon::create(2016, 1, 5, 22, 40, 32);
@@ -7574,9 +7574,9 @@ Serialization
$dt = Carbon::create(2012, 12, 25, 20, 30, 00, 'Europe/Moscow');
-echo serialize($dt); // O:13:"Carbon\Carbon":3:{s:4:"date";s:26:"2012-12-25 20:30:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:13:"Europe/Moscow";}
+echo serialize($dt); // O:13:"Carbon\Carbon":4:{s:4:"date";s:26:"2012-12-25 20:30:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:13:"Europe/Moscow";s:18:"dumpDateProperties";a:2:{s:4:"date";s:26:"2012-12-25 20:30:00.000000";s:8:"timezone";s:13:"Europe/Moscow";}}
// same as:
-echo $dt->serialize(); // O:13:"Carbon\Carbon":3:{s:4:"date";s:26:"2012-12-25 20:30:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:13:"Europe/Moscow";}
+echo $dt->serialize(); // O:13:"Carbon\Carbon":4:{s:4:"date";s:26:"2012-12-25 20:30:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:13:"Europe/Moscow";s:18:"dumpDateProperties";a:2:{s:4:"date";s:26:"2012-12-25 20:30:00.000000";s:8:"timezone";s:13:"Europe/Moscow";}}
$dt = 'O:13:"Carbon\Carbon":3:{s:4:"date";s:26:"2012-12-25 20:30:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:13:"Europe/Moscow";}';
@@ -7704,9 +7704,9 @@ Macro
// Then now you can easily display any date in a page/e-mail using those user settings and the chosen format
echo Carbon::parse($dateString, 'UTC')->formatForUser(); // 23/01/2010
echo "\n";
-echo Carbon::tomorrow()->formatForUser(); // Aujourd’hui à 02:00
+echo Carbon::tomorrow()->formatForUser(); // Demain à 02:00
echo "\n";
-echo Carbon::now()->subDays(3)->formatForUser(); // lundi dernier à 00:29
+echo Carbon::now()->subDays(3)->formatForUser(); // lundi dernier à 09:08
@@ -8951,7 +8951,7 @@ CarbonPeriod
$days[] = $date->format('Y-m-d');
}
-echo implode(', ', $days); // 2024-10-09, 2024-10-10, 2024-10-11
+echo implode(', ', $days); // 2024-10-10, 2024-10-11, 2024-10-12
diff --git a/reference/index.html b/reference/index.html
index 042190c072..1d3b3e29de 100644
--- a/reference/index.html
+++ b/reference/index.html
@@ -24,7 +24,7 @@ Carbon::__serialize
returns array
Returns the values to dump on serialize() called on.
Only used by PHP >= 7.4.
- Method added | 1.37.1 | no arguments |
+ Method added | 1.21.0 | no arguments |
@@ -33,7 +33,7 @@ Carbon::__unserialize
array $data
Set locale if specified on unserialize() called.
Only used by PHP >= 7.4.
- Method added | 1.37.1 | array $data |
+ Method added | 1.21.0 | array $data |
@@ -94,7 +94,7 @@ Carbon::format
string $format
returns string
Returns the formatted date string on success or FALSE on failure.
- Prototype changed | 3.0.0 | string $format |
Prototype changed | 2.16.0 | $format |
Prototype changed | 1.37.1 | string $format |
+ Prototype changed | 3.0.0 | string $format |
Prototype changed | 2.16.0 | $format |
Prototype changed | 1.21.0 | string $format |
Method added | 1.0.0 | $format |
@@ -104,7 +104,7 @@ Carbon::modify
$modify
returns Carbon
Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else.
- Prototype changed | 2.23.0 | $modify |
Prototype changed | 1.37.1 | string $modifier |
+ Prototype changed | 2.23.0 | $modify |
Prototype changed | 1.23.0 | string $modifier |
Prototype changed | 1.22.0 | $modify |
Prototype changed | 1.21.0 | string $modifier |
Method added | 1.0.0 | $modify |
@@ -114,7 +114,7 @@ Carbon::add
$unit, $value = 1, ?bool $overflow = null
returns Carbon
Add given units or interval to the current instance.
Examples:
$date->add('hour', 3)
$date->add(15, 'days')
$date->add(CarbonInterval::days(4))
- Prototype changed | 3.0.0 | $unit, $value = 1, ?bool $overflow = null |
Prototype changed | 2.0.0 | $unit, $value = 1, $overflow = null |
Prototype changed | 1.37.1 | DateInterval $interval |
+ Prototype changed | 3.0.0 | $unit, $value = 1, ?bool $overflow = null |
Prototype changed | 2.0.0 | $unit, $value = 1, $overflow = null |
Prototype changed | 1.21.0 | DateInterval $interval |
Method added | 1.0.0 | $interval |
@@ -124,7 +124,7 @@ Carbon::sub
$unit, $value = 1, ?bool $overflow = null
returns Carbon
Subtract given units or interval to the current instance.
Examples:
$date->sub('hour', 3)
$date->sub(15, 'days')
$date->sub(CarbonInterval::days(4))
- Prototype changed | 3.0.0 | $unit, $value = 1, ?bool $overflow = null |
Prototype changed | 2.0.0 | $unit, $value = 1, $overflow = null |
Prototype changed | 1.37.1 | DateInterval $interval |
+ Prototype changed | 3.0.0 | $unit, $value = 1, ?bool $overflow = null |
Prototype changed | 2.0.0 | $unit, $value = 1, $overflow = null |
Prototype changed | 1.21.0 | DateInterval $interval |
Method added | 1.0.0 | $interval |
@@ -160,7 +160,7 @@ Carbon::setTime
int $hour, int $minute, int $second = 0, int $microseconds = 0
returns Carbon
Resets the current time of the DateTime object to a different time.
- Prototype changed | 3.0.0 | int $hour, int $minute, int $second = 0, int $microseconds = 0 |
Prototype changed | 2.23.0 | $hour, $minute, $second = 0, $microseconds = 0 |
Prototype changed | 1.37.1 | int $hour, int $minute, int $second = 0, int $microsecond = 0 |
Prototype changed | 1.15.0 | $hour, $minute, $second, $microseconds |
+ Prototype changed | 3.0.0 | int $hour, int $minute, int $second = 0, int $microseconds = 0 |
Prototype changed | 2.23.0 | $hour, $minute, $second = 0, $microseconds = 0 |
Prototype changed | 1.21.0 | int $hour, int $minute, int $second = 0, int $microsecond = 0 |
Prototype changed | 1.15.0 | $hour, $minute, $second, $microseconds |
Method added | 1.0.0 | $hour, $minute, $second = 0 |
@@ -170,7 +170,7 @@ Carbon::setDate
int $year, int $month, int $day
returns Carbon
Set the date with gregorian year, month and day numbers.
- Prototype changed | 3.0.0 | int $year, int $month, int $day |
Prototype changed | 2.23.0 | $year, $month, $day |
Prototype changed | 2.0.0 | int $year, int $month, int $day |
+ Prototype changed | 3.0.0 | int $year, int $month, int $day |
Prototype changed | 2.23.0 | $year, $month, $day |
Prototype changed | 2.0.0 | int $year, int $month, int $day |
Prototype changed | 1.22.0 | $year, $month, $day |
Prototype changed | 1.21.0 | int $year, int $month, int $day |
Method added | 1.0.0 | $year, $month, $day |
@@ -180,7 +180,7 @@ Carbon::setISODate
int $year, int $week, int $day = 1
returns Carbon
Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates.
- Prototype changed | 3.0.0 | int $year, int $week, int $day = 1 |
Prototype changed | 2.23.0 | $year, $week, $day = 1 |
Prototype changed | 1.37.1 | int $year, int $week, int $dayOfWeek = 1 |
+ Prototype changed | 3.0.0 | int $year, int $week, int $day = 1 |
Prototype changed | 2.23.0 | $year, $week, $day = 1 |
Prototype changed | 1.21.0 | int $year, int $week, int $dayOfWeek = 1 |
Method added | 1.0.0 | $year, $week, $day |
@@ -190,7 +190,7 @@ Carbon::setTimestamp
string|int|float $timestamp
returns Carbon
Set the instance's timestamp.
Timestamp input can be given as int, float or a string containing one or more numbers.
- Prototype changed | 3.0.0 | string|int|float $timestamp |
Prototype changed | 2.41.0 | $unixTimestamp |
Prototype changed | 2.23.0 | $unixtimestamp |
Prototype changed | 1.37.1 | int $timestamp |
+ Prototype changed | 3.0.0 | string|int|float $timestamp |
Prototype changed | 2.41.0 | $unixTimestamp |
Prototype changed | 2.23.0 | $unixtimestamp |
Prototype changed | 1.21.0 | int $timestamp |
Method added | 1.0.0 | $unixtimestamp |
@@ -208,7 +208,7 @@ Carbon::diff
@alias diffAsCarbonInterval
Get the difference as a DateInterval instance.
Return relative interval (negative if $absolute flag is not set to true and the given date is before
current one).
- Prototype changed | 3.0.0 | $date = null, bool $absolute = false, array $skip = [] |
Prototype changed | 2.23.0 | $date = null, $absolute = false |
Prototype changed | 1.37.1 | DateTimeInterface $targetObject, bool $absolute = false |
+ Prototype changed | 3.0.0 | $date = null, bool $absolute = false, array $skip = [] |
Prototype changed | 2.23.0 | $date = null, $absolute = false |
Prototype changed | 1.21.0 | DateTimeInterface $targetObject, bool $absolute = false |
Method added | 1.0.0 | $object, $absolute |
@@ -1391,7 +1391,7 @@ Carbon::isSameAs
Compares the formatted values of the two dates.
Examples:
Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-12-13')); // true
Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-06-14')); // false
Prototype changed | 3.0.0 | string $format, DateTimeInterface|string $date |
Prototype changed | 1.23.0 | $format, $date = null |
- Method added | 1.22.0 | $format, Carbon\Carbon $date = null |
+ Method added | 1.22.0 | $format, ?Carbon\Carbon $date = null |
@@ -1439,7 +1439,7 @@ Carbon::isSameMonth
Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01')); // false
Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01'), false); // true
Prototype changed | 3.0.0 | DateTimeInterface|string $date, bool $ofSameYear = true |
Prototype changed | 2.0.0 | $date = null, $ofSameYear = true |
Prototype changed | 1.29.2 | $date = null, $ofSameYear = null |
Prototype changed | 1.23.0 | $date = null, $ofSameYear = false |
- Method added | 1.22.0 | Carbon\Carbon $date = null, $ofSameYear = false |
+ Method added | 1.22.0 | ?Carbon\Carbon $date = null, $ofSameYear = false |
@@ -1464,7 +1464,7 @@ Carbon::isBirthday
Carbon::now()->subYears(5)->subDay()->isBirthday(); // false
Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-05')); // true
Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-06')); // false
- Prototype changed | 3.0.0 | DateTimeInterface|string|null $date = null |
Prototype changed | 1.23.0 | $date = null |
Prototype changed | 1.21.0 | Carbon\Carbon $date = null |
+ Prototype changed | 3.0.0 | DateTimeInterface|string|null $date = null |
Prototype changed | 1.23.0 | $date = null |
Prototype changed | 1.21.0 | ?Carbon\Carbon $date = null |
Method added | 1.14.0 | Carbon\Carbon $date |
@@ -2485,7 +2485,7 @@ Carbon::diffInYears
$date = null, bool $absolute = false, bool $utc = false
returns float
Get the difference in years
- Prototype changed | 3.2.0 | $date = null, bool $absolute = false, bool $utc = false |
Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | self $date = null, $absolute = true |
+ Prototype changed | 3.2.0 | $date = null, bool $absolute = false, bool $utc = false |
Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | ?self $date = null, $absolute = true |
Prototype changed | 1.21.0 | ?Carbon\Carbon $date = null, $absolute = true |
Method added | 1.0.0 | Carbon\Carbon $date = null, $absolute = true |
@@ -2505,7 +2505,7 @@ Carbon::diffInMonths
$date = null, bool $absolute = false, bool $utc = false
returns float
Get the difference in months.
- Prototype changed | 3.2.0 | $date = null, bool $absolute = false, bool $utc = false |
Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | self $date = null, $absolute = true |
+ Prototype changed | 3.2.0 | $date = null, bool $absolute = false, bool $utc = false |
Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | ?self $date = null, $absolute = true |
Prototype changed | 1.21.0 | ?Carbon\Carbon $date = null, $absolute = true |
Method added | 1.0.0 | Carbon\Carbon $date = null, $absolute = true |
@@ -2515,7 +2515,7 @@ Carbon::diffInWeeks
$date = null, bool $absolute = false, bool $utc = false
returns float
Get the difference in weeks.
- Prototype changed | 3.2.0 | $date = null, bool $absolute = false, bool $utc = false |
Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | self $date = null, $absolute = true |
+ Prototype changed | 3.2.0 | $date = null, bool $absolute = false, bool $utc = false |
Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | ?self $date = null, $absolute = true |
Prototype changed | 1.21.0 | ?Carbon\Carbon $date = null, $absolute = true |
Method added | 1.11.0 | Carbon\Carbon $date = null, $absolute = true |
@@ -2525,7 +2525,7 @@ Carbon::diffInDays
$date = null, bool $absolute = false, bool $utc = false
returns float
Get the difference in days.
- Prototype changed | 3.2.0 | $date = null, bool $absolute = false, bool $utc = false |
Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | self $date = null, $absolute = true |
+ Prototype changed | 3.2.0 | $date = null, bool $absolute = false, bool $utc = false |
Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | ?self $date = null, $absolute = true |
Prototype changed | 1.21.0 | ?Carbon\Carbon $date = null, $absolute = true |
Method added | 1.0.0 | Carbon\Carbon $date = null, $absolute = true |
@@ -2535,7 +2535,7 @@ Carbon::diffInDaysFiltered
Closure $callback, $date = null, bool $absolute = false
returns int
Get the difference in days using a filter closure.
- Prototype changed | 3.0.0 | Closure $callback, $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | Closure $callback, $date = null, $absolute = true |
Prototype changed | 1.23.0 | Closure $callback, self $date = null, $absolute = true |
+ Prototype changed | 3.0.0 | Closure $callback, $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | Closure $callback, $date = null, $absolute = true |
Prototype changed | 1.23.0 | Closure $callback, ?self $date = null, $absolute = true |
Prototype changed | 1.21.0 | Closure $callback, ?Carbon\Carbon $date = null, $absolute = true |
Method added | 1.12.0 | Closure $callback, Carbon\Carbon $date = null, $absolute = true |
@@ -2545,7 +2545,7 @@ Carbon::diffInHoursFiltered
Closure $callback, $date = null, bool $absolute = false
returns int
Get the difference in hours using a filter closure.
- Prototype changed | 3.0.0 | Closure $callback, $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | Closure $callback, $date = null, $absolute = true |
Prototype changed | 1.23.0 | Closure $callback, self $date = null, $absolute = true |
+ Prototype changed | 3.0.0 | Closure $callback, $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | Closure $callback, $date = null, $absolute = true |
Prototype changed | 1.23.0 | Closure $callback, ?self $date = null, $absolute = true |
Prototype changed | 1.21.0 | Closure $callback, ?Carbon\Carbon $date = null, $absolute = true |
Method added | 1.18.0 | Closure $callback, Carbon\Carbon $date = null, $absolute = true |
@@ -2555,7 +2555,7 @@ Carbon::diffFiltered
Carbon\CarbonInterval $ci, Closure $callback, $date = null, bool $absolute = false
returns int
Get the difference by the given interval using a filter closure.
- Prototype changed | 3.0.0 | Carbon\CarbonInterval $ci, Closure $callback, $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | Carbon\CarbonInterval $ci, Closure $callback, $date = null, $absolute = true |
Prototype changed | 1.23.0 | Carbon\CarbonInterval $ci, Closure $callback, self $date = null, $absolute = true |
+ Prototype changed | 3.0.0 | Carbon\CarbonInterval $ci, Closure $callback, $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | Carbon\CarbonInterval $ci, Closure $callback, $date = null, $absolute = true |
Prototype changed | 1.23.0 | Carbon\CarbonInterval $ci, Closure $callback, ?self $date = null, $absolute = true |
Prototype changed | 1.21.0 | Carbon\CarbonInterval $ci, Closure $callback, ?Carbon\Carbon $date = null, $absolute = true |
Method added | 1.18.0 | Carbon\CarbonInterval $ci, Closure $callback, Carbon\Carbon $date = null, $absolute = true |
@@ -2565,7 +2565,7 @@ Carbon::diffInWeekdays
$date = null, bool $absolute = false
returns int
Get the difference in weekdays.
- Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | self $date = null, $absolute = true |
+ Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | ?self $date = null, $absolute = true |
Prototype changed | 1.21.0 | ?Carbon\Carbon $date = null, $absolute = true |
Method added | 1.12.0 | Carbon\Carbon $date = null, $absolute = true |
@@ -2575,7 +2575,7 @@ Carbon::diffInWeekendDays
$date = null, bool $absolute = false
returns int
Get the difference in weekend days using a filter.
- Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | self $date = null, $absolute = true |
+ Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | ?self $date = null, $absolute = true |
Prototype changed | 1.21.0 | ?Carbon\Carbon $date = null, $absolute = true |
Method added | 1.12.0 | Carbon\Carbon $date = null, $absolute = true |
@@ -2585,7 +2585,7 @@ Carbon::diffInHours
$date = null, bool $absolute = false
returns float
Get the difference in hours.
- Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | self $date = null, $absolute = true |
+ Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | ?self $date = null, $absolute = true |
Prototype changed | 1.21.0 | ?Carbon\Carbon $date = null, $absolute = true |
Method added | 1.0.0 | Carbon\Carbon $date = null, $absolute = true |
@@ -2595,7 +2595,7 @@ Carbon::diffInMinutes
$date = null, bool $absolute = false
returns float
Get the difference in minutes.
- Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | self $date = null, $absolute = true |
+ Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | ?self $date = null, $absolute = true |
Prototype changed | 1.21.0 | ?Carbon\Carbon $date = null, $absolute = true |
Method added | 1.0.0 | Carbon\Carbon $date = null, $absolute = true |
@@ -2605,7 +2605,7 @@ Carbon::diffInSeconds
$date = null, bool $absolute = false
returns float
Get the difference in seconds.
- Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | self $date = null, $absolute = true |
+ Prototype changed | 3.0.0 | $date = null, bool $absolute = false |
Prototype changed | 1.24.0 | $date = null, $absolute = true |
Prototype changed | 1.23.0 | ?self $date = null, $absolute = true |
Prototype changed | 1.21.0 | ?Carbon\Carbon $date = null, $absolute = true |
Method added | 1.0.0 | Carbon\Carbon $date = null, $absolute = true |
@@ -2660,7 +2660,7 @@ Carbon::diffForHumans
echo Carbon::tomorrow()->diffForHumans(['parts' => 3, 'join' => true]) . "\n";
echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday()) . "\n";
echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday(), ['short' => true]) . "\n";
- Prototype changed | 2.0.0 | $other = null, $syntax = null, $short = false, $parts = 1, $options = null |
Prototype changed | 1.25.0 | $other = null, $absolute = false, $short = false, $parts = 1 |
Prototype changed | 1.23.0 | self $other = null, $absolute = false, $short = false, $parts = 1 |
Prototype changed | 1.22.0 | Carbon\Carbon $other = null, $absolute = false, $short = false |
Prototype changed | 1.14.0 | Carbon\Carbon $other = null, $absolute = false |
+ Prototype changed | 2.0.0 | $other = null, $syntax = null, $short = false, $parts = 1, $options = null |
Prototype changed | 1.25.0 | $other = null, $absolute = false, $short = false, $parts = 1 |
Prototype changed | 1.23.0 | ?self $other = null, $absolute = false, $short = false, $parts = 1 |
Prototype changed | 1.22.0 | ?Carbon\Carbon $other = null, $absolute = false, $short = false |
Prototype changed | 1.21.0 | ?Carbon\Carbon $other = null, $absolute = false |
Prototype changed | 1.14.0 | Carbon\Carbon $other = null, $absolute = false |
Method added | 1.0.0 | Carbon\Carbon $other = null |
@@ -3093,7 +3093,7 @@ Carbon::average
returns Carbon
Modify the current instance to the average of a given instance (default now) and the current instance
(second-precision).
- Prototype changed | 1.24.0 | $date = null |
Prototype changed | 1.23.0 | self $date = null |
+ Prototype changed | 1.24.0 | $date = null |
Prototype changed | 1.23.0 | ?self $date = null |
Prototype changed | 1.21.0 | ?Carbon\Carbon $date = null |
Method added | 1.7.0 | Carbon\Carbon $date = null |
@@ -3123,7 +3123,7 @@ Carbon::min
$date = null
returns Carbon
Get the minimum instance between a given instance (default now) and the current instance.
- Prototype changed | 1.24.0 | $date = null |
Prototype changed | 1.23.0 | self $date = null |
+ Prototype changed | 1.24.0 | $date = null |
Prototype changed | 1.23.0 | ?self $date = null |
Prototype changed | 1.21.0 | ?Carbon\Carbon $date = null |
Method added | 1.8.0 | Carbon\Carbon $date = null |
@@ -3133,8 +3133,8 @@ Carbon::minimum
$date = null
returns Carbon
Get the minimum instance between a given instance (default now) and the current instance.
- Prototype changed | 1.24.0 | $date = null |
Prototype changed | 1.23.0 | self $date = null |
- Method added | 1.22.0 | Carbon\Carbon $date = null |
+ Prototype changed | 1.24.0 | $date = null |
Prototype changed | 1.23.0 | ?self $date = null |
+ Method added | 1.22.0 | ?Carbon\Carbon $date = null |
@@ -3143,7 +3143,7 @@ Carbon::max
$date = null
returns Carbon
Get the maximum instance between a given instance (default now) and the current instance.
- Prototype changed | 1.24.0 | $date = null |
Prototype changed | 1.23.0 | self $date = null |
+ Prototype changed | 1.24.0 | $date = null |
Prototype changed | 1.23.0 | ?self $date = null |
Prototype changed | 1.21.0 | ?Carbon\Carbon $date = null |
Method added | 1.8.0 | Carbon\Carbon $date = null |
@@ -3153,8 +3153,8 @@ Carbon::maximum
$date = null
returns Carbon
Get the maximum instance between a given instance (default now) and the current instance.
- Prototype changed | 1.24.0 | $date = null |
Prototype changed | 1.23.0 | self $date = null |
- Method added | 1.22.0 | Carbon\Carbon $date = null |
+ Prototype changed | 1.24.0 | $date = null |
Prototype changed | 1.23.0 | ?self $date = null |
+ Method added | 1.22.0 | ?Carbon\Carbon $date = null |
@@ -3791,7 +3791,7 @@ Carbon::setTestNow
has no affect as the mock value will be returned regardless of its value.
Only the moment is mocked with setTestNow(), the timezone will still be the one passed
as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()).
To clear the test instance call this method using the default
parameter of null.
/!\ Use this method for unit tests only.
- Prototype changed | 3.0.0 | mixed $testNow = null |
Prototype changed | 1.22.0 | $testNow = null |
+ Prototype changed | 3.0.0 | mixed $testNow = null |
Prototype changed | 1.22.0 | $testNow = null |
Prototype changed | 1.21.0 | ?Carbon\Carbon $testNow = null |
Method added | 1.3.0 | Carbon\Carbon $testNow = null |
@@ -5757,7 +5757,7 @@ CarbonInterval::createFromDateString
string $datetime
returns CarbonInterval
Sets up a DateInterval from the relative parts of the string.
- Prototype changed | 3.0.0 | string $datetime |
Prototype changed | 2.0.0 | $time |
Prototype changed | 1.37.1 | string $datetime |
+ Prototype changed | 3.0.0 | string $datetime |
Prototype changed | 2.0.0 | $time |
Prototype changed | 1.21.0 | string $datetime |
Method added | 1.18.0 | $time |
@@ -5918,7 +5918,7 @@ CarbonInterval::format
string $format
returns string
Returns the formatted date string on success or FALSE on failure.
- Prototype changed | 1.37.1 | string $format |
+ Prototype changed | 1.21.0 | string $format |
Method added | 1.18.0 | $format |
@@ -6384,7 +6384,7 @@ CarbonInterval::__unserialize
array $data
Set locale if specified on unserialize() called.
Only used by PHP >= 7.4.
- Method added | 1.37.1 | array $data |
+ Method added | 1.21.0 | array $data |
@@ -8712,8 +8712,8 @@ Translator::__construct
$locale, ?Symfony\Component\Translation\Formatter\MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false
Create a new Carbon instance.
Please see the testing aids section (specifically static::setTestNow())
for more on the possibility of this constructor returning a test instance.
- Prototype changed | 1.37.1 | $locale, ?Symfony\Component\Translation\Formatter\MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false |
- Method added | 1.25.0 | $locale, Symfony\Component\Translation\Formatter\MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false |
+
+ Method added | 1.25.0 | $locale, ?Symfony\Component\Translation\Formatter\MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false |
@@ -9249,7 +9249,7 @@ Carbon::isSameYear
returns bool
Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
Prototype changed | 3.2.0 | DateTimeInterface|string $date |
Prototype changed | 2.34.2 | Carbon|DateTimeInterface|string|null $date = null |
Prototype changed | 2.24.0 | \Carbon\Carbon|\DateTimeInterface|string|null $date = null |
Prototype changed | 2.0.0 | \DateTimeInterface $date = null |
Prototype changed | 1.23.0 | $date = null |
- Method added | 1.22.0 | Carbon\Carbon $date = null |
+ Method added | 1.22.0 | ?Carbon\Carbon $date = null |
From c112a5b0facd165b9c33554eb1e2d38cee2df1a5 Mon Sep 17 00:00:00 2001
From: StyleCI Bot
Date: Thu, 10 Oct 2024 07:52:53 +0000
Subject: [PATCH 2/2] Apply fixes from StyleCI
---
tools/api-history.php | 2 +-
tools/generate.php | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/api-history.php b/tools/api-history.php
index 05ef292ca5..9a3552cb09 100644
--- a/tools/api-history.php
+++ b/tools/api-history.php
@@ -258,7 +258,7 @@ function getMethodsOfVersion($version, bool $forceRebuild = false)
$branch = $version === MASTER_VERSION ? MASTER_BRANCH : $version;
$baseDir = dirname(__DIR__);
- $sandboxDir = $baseDir . DIRECTORY_SEPARATOR . 'sandbox';
+ $sandboxDir = $baseDir.DIRECTORY_SEPARATOR.'sandbox';
removeDirectory($sandboxDir);
mkdir($sandboxDir);
chdir($sandboxDir);
diff --git a/tools/generate.php b/tools/generate.php
index 2c9f7ef057..75544e52a8 100644
--- a/tools/generate.php
+++ b/tools/generate.php
@@ -277,7 +277,7 @@ function getAllBackers(): array
'isActive' => true,
'totalAmountDonated' => 1000,
'currency' => 'USD',
- 'lastTransactionAt' => CarbonImmutable::now()->format('Y-m-d') . ' 02:00',
+ 'lastTransactionAt' => CarbonImmutable::now()->format('Y-m-d').' 02:00',
'lastTransactionAmount' => 25,
'profile' => 'https://tidelift.com/',
'name' => 'Tidelift',
@@ -379,7 +379,7 @@ function getOpenCollective(string $status): string
$width = $validImage ? round($x * $height / $y) : $height;
if (!str_contains($href, 'utm_source') && !preg_match('/^https?:\/\/onlinekasyno-polis\.pl(\/.*)?$/', $href)) {
- $href .= (!str_contains($href, '?') ? '?' : '&') . 'utm_source=opencollective&utm_medium=github&utm_campaign=Carbon';
+ $href .= (!str_contains($href, '?') ? '?' : '&').'utm_source=opencollective&utm_medium=github&utm_campaign=Carbon';
}
$title = htmlspecialchars(($member['description'] ?? null) ?: $member['name']);