Framework Update
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace PHPSTORM_META {
|
||||
registerArgumentsSet("date_units", "millenania", "millennium", "century", "centuries", "decade", "decades", "year", "years", "y", "yr", "yrs", "quarter", "quarters", "month", "months", "mo", "mos", "week", "weeks", "w", "day", "days", "d", "hour", "hours", "h", "minute", "minutes", "m", "second", "seconds", "s", "millisecond", "milliseconds", "milli", "ms", "microsecond", "microseconds", "micro", "µs");
|
||||
expectedArguments(\Carbon\Traits\Units::add(), 0, argumentsSet("date_units"));
|
||||
expectedArguments(\Carbon\Traits\Units::add(), 1, argumentsSet("date_units"));
|
||||
expectedArguments(\Carbon\CarbonInterface::add(), 0, argumentsSet("date_units"));
|
||||
expectedArguments(\Carbon\CarbonInterface::add(), 1, argumentsSet("date_units"));
|
||||
|
||||
expectedArguments(\Carbon\CarbonInterface::getTimeFormatByPrecision(), 0, "minute", "second", "m", "millisecond", "µ", "microsecond", "minutes", "seconds", "ms", "milliseconds", "µs", "microseconds");
|
||||
}
|
||||
Vendored
+10
-3
@@ -42,13 +42,15 @@
|
||||
"require": {
|
||||
"php": "^7.1.8 || ^8.0",
|
||||
"ext-json": "*",
|
||||
"carbonphp/carbon-doctrine-types": "*",
|
||||
"psr/clock": "^1.0",
|
||||
"symfony/polyfill-mbstring": "^1.0",
|
||||
"symfony/polyfill-php80": "^1.16",
|
||||
"symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/dbal": "^2.0 || ^3.1.4",
|
||||
"doctrine/orm": "^2.7",
|
||||
"doctrine/dbal": "^2.0 || ^3.1.4 || ^4.0",
|
||||
"doctrine/orm": "^2.7 || ^3.0",
|
||||
"friendsofphp/php-cs-fixer": "^3.0",
|
||||
"kylekatarnls/multi-tester": "^2.0",
|
||||
"ondrejmirtes/better-reflection": "*",
|
||||
@@ -59,6 +61,9 @@
|
||||
"phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20",
|
||||
"squizlabs/php_codesniffer": "^3.4"
|
||||
},
|
||||
"provide": {
|
||||
"psr/clock-implementation": "1.0"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"autoload": {
|
||||
@@ -105,6 +110,7 @@
|
||||
"phpcs": "php-cs-fixer fix -v --diff --dry-run",
|
||||
"phpdoc": "php phpdoc.php",
|
||||
"phpmd": "phpmd src text /phpmd.xml",
|
||||
"phpmd-test": "phpmd tests text /tests/phpmd-test.xml",
|
||||
"phpstan": "phpstan analyse --configuration phpstan.neon",
|
||||
"phpunit": "phpunit --verbose",
|
||||
"style-check": [
|
||||
@@ -115,6 +121,7 @@
|
||||
"test": [
|
||||
"@phpunit",
|
||||
"@style-check"
|
||||
]
|
||||
],
|
||||
"sponsors": "php sponsors.php"
|
||||
}
|
||||
}
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\MessageFormatter;
|
||||
|
||||
use Symfony\Component\Translation\Formatter\MessageFormatterInterface;
|
||||
|
||||
if (!class_exists(LazyMessageFormatter::class, false)) {
|
||||
abstract class LazyMessageFormatter implements MessageFormatterInterface
|
||||
{
|
||||
public function format(string $message, string $locale, array $parameters = []): string
|
||||
{
|
||||
return $this->formatter->format(
|
||||
$message,
|
||||
$this->transformLocale($locale),
|
||||
$parameters
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\MessageFormatter;
|
||||
|
||||
use Symfony\Component\Translation\Formatter\ChoiceMessageFormatterInterface;
|
||||
use Symfony\Component\Translation\Formatter\MessageFormatterInterface;
|
||||
|
||||
if (!class_exists(LazyMessageFormatter::class, false)) {
|
||||
abstract class LazyMessageFormatter implements MessageFormatterInterface, ChoiceMessageFormatterInterface
|
||||
{
|
||||
abstract protected function transformLocale(?string $locale): ?string;
|
||||
|
||||
public function format($message, $locale, array $parameters = [])
|
||||
{
|
||||
return $this->formatter->format(
|
||||
$message,
|
||||
$this->transformLocale($locale),
|
||||
$parameters
|
||||
);
|
||||
}
|
||||
|
||||
public function choiceFormat($message, $number, $locale, array $parameters = [])
|
||||
{
|
||||
return $this->formatter->choiceFormat($message, $number, $locale, $parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+37
-17
@@ -2,7 +2,7 @@
|
||||
|
||||
[](https://packagist.org/packages/nesbot/carbon)
|
||||
[](https://packagist.org/packages/nesbot/carbon)
|
||||
[](https://actions-badge.atrox.dev/briannesbitt/Carbon/goto)
|
||||
[](https://github.com/briannesbitt/Carbon/actions)
|
||||
[](https://codecov.io/github/briannesbitt/Carbon?branch=master)
|
||||
[](https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme)
|
||||
|
||||
@@ -119,30 +119,50 @@ This project exists thanks to all the people who contribute.
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
|
||||
|
||||
<a href="https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme" target="_blank"><img src="https://carbon.nesbot.com/tidelift-brand.png" width="256" height="64"></a>
|
||||
<a href="https://casinohex.org/canada/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img src="https://images.opencollective.com/hexcasinoca/2da3af2/logo/256.png" width="85" height="64"></a>
|
||||
<a href="https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme" target="_blank"><img src="https://carbon.nesbot.com/tidelift-brand.png" width="256" height="64"></a><!-- <open-collective-sponsors> -->
|
||||
<a title="Онлайн казино 777 Україна" href="https://777.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/7e572d50-1ce8-4d69-ae12-86cc80371373/ok-ua-777.png" width="64" height="64"></a>
|
||||
<a title="#1 Guide To Online Gambling In Canada" href="https://casinohex.org/canada/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="CasinoHex Canada" src="https://opencollective-production.s3.us-west-1.amazonaws.com/79fdbcc0-a997-11eb-abbc-25e48b63c6dc.jpg" width="85" height="64"></a>
|
||||
<a title="Znajdź najlepsze zakłady bukmacherskie w Polsce w 2023 roku. Probukmacher.pl to Twoje kompendium wiedzy na temat bukmacherów!" href="https://www.probukmacher.pl?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Probukmacher" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/caf50271-4560-4ffe-a434-ea15239168db/Screenshot_1.png" width="89" height="64"></a>
|
||||
<a title="Gives a fun for our users" href="https://slotoking.ua/games/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Игровые автоматы" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/94601d07-3205-4c60-9c2d-9b8194dbefb7/skg-blue.png" width="64" height="64"></a>
|
||||
<a title="Casino-portugal.pt" href="https://casino-portugal.pt/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Casino-portugal.pt" src="https://logo.clearbit.com/casino-portugal.pt" width="64" height="64"></a>
|
||||
<a title="Slots City® ➢ Лучшее лицензионно казино онлайн и оффлайн на гривны в Украине. 【 Более1500 игровых автоматов и слотов】✅ Официально и Безопасно" href="https://slotscity.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Slots City" src="https://opencollective-production.s3.us-west-1.amazonaws.com/d7e298c0-7abe-11ed-8553-230872f5e54d.png" width="90" height="64"></a>
|
||||
<a title="inkedin" href="https://inkedin.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="inkedin" src="https://logo.clearbit.com/inkedin.com" width="64" height="64"></a>
|
||||
<a title="Актуальний та повносправний рейтинг онлайн казино України, ґрунтований на відгуках реальних гравців." href="https://uk.onlinecasino.in.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино України" src="https://opencollective-production.s3.us-west-1.amazonaws.com/c0b4b090-eef8-11ec-9cb7-0527a205b226.png" width="64" height="64"></a>
|
||||
<a title="OnlineCasinosSpelen" href="https://onlinecasinosspelen.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="OnlineCasinosSpelen" src="https://logo.clearbit.com/onlinecasinosspelen.com" width="64" height="64"></a>
|
||||
<a title="Best non Gamstop sites in the UK" href="https://nongamstopcasinos.net/gb/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Best non Gamstop sites in the UK" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/34e340b8-e1de-4932-8a76-1b3ce2ec7ee8/logo_white%20bg%20(8).png" width="64" height="64"></a>
|
||||
<a title="Real Money Pokies" href="https://www.nzfirst.org.nz/real-money-pokies/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Real Money Pokies" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/30d38232-a9d6-4e95-a48c-641fdc4d96fd/NZ_logo%20(6)%20(1)%20(1).jpg" width="64" height="64"></a>
|
||||
<a title="Non GamStop Bookies UK" href="https://nongamstopbookies.com/uk/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Non GamStop Bookies UK" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/43c5561c-8907-4ef7-a4ee-c6da054788b8/logo-site%20(3).jpg" width="64" height="64"></a>
|
||||
<a title="Актуальний топ-рейтинг українських онлайн казино на гривні! Щоденне оновлення топу та унікальна система ранжування, основана на відгуках гравців!" href="https://onlinecasino.in.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Онлайн Казино Украины" src="https://opencollective-production.s3.us-west-1.amazonaws.com/8fdd8aa0-e273-11ec-a95e-d38fd331cabf.png" width="64" height="64"></a>
|
||||
<a title="Entertainment" href="https://www.nongamstopbets.com/casinos-not-on-gamstop/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Non-GamStop Bets UK" src="https://logo.clearbit.com/nongamstopbets.com" width="64" height="64"></a>
|
||||
<a title="Chudovo - international software development company with representative offices in Kyiv, Cologne, New York, Tallinn and London. It has been working on the market since 2006. Company has domain expertise in video security, logistics, medicine, finance and" href="https://chudovo.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Chudovo" src="https://opencollective-production.s3.us-west-1.amazonaws.com/326c19a0-2e87-11eb-a13a-c99a2a201d11.png" width="84" height="42"></a>
|
||||
<a title="Entertainment" href="https://casinogap.org/uk/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="UK Casino Gap" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/143f9301-beec-4118-89d5-9a07a01345f3/casinogap-uk.png" width="42" height="42"></a>
|
||||
<a title="NZ Gaming Portal" href="https://casinodeps.co.nz?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="NZ Casino Deps" src="https://logo.clearbit.com/casinodeps.co.nz" width="42" height="42"></a>
|
||||
<a title="NonStop Sites" href="https://uk.nonstopcasino.org/non-gamstop-casinos/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="NonStopCasino.org" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/fd7ad905-8752-468f-ad20-582a24cca9d9/non-stop-casino.png" width="42" height="42"></a>
|
||||
<a title="Siti Non AAMS" href="https://www.outlookindia.com/outlook-spotlight/migliori-siti-non-aams-siti-scommesse-senza-licenza-sicuri-news-294715?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Migliori Siti Non AAMS" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/392810da-6cb6-4938-a3cb-38bd0e1eb7de/migliori-siti-non-aams.png" width="42" height="42"></a>
|
||||
<a title="List of trusted non GamStop casino reviews" href="https://nongamstopcasinos.org?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="UK NonGamStopCasinos" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/cbda0ee1-26ea-4252-9580-f1f9b317b1f7/nongamstopcasinos-uk.png" width="42" height="42"></a>
|
||||
<a title="Online TikTok Video Download Tool" href="https://snaptik.pro?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="SnapTik" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/546bcd53-6615-457d-ab21-1db1c52b3af5/logo.jpg" width="42" height="42"></a>
|
||||
<a title="IG Downloader is an Instagram Downloader service that offers a variety of tools to download Instagram content for free. Listed below are all the tools" href="https://indownloader.app/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="IG Downloader" src="https://logo.clearbit.com/indownloader.app" width="42" height="42"></a>
|
||||
<a title="Proxidize is a mobile proxy creation and management platform that provides all needed components from hardware to cloud software and SIM cards." href="https://proxidize.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Proxidize" src="https://logo.clearbit.com/proxidize.com" width="42" height="42"></a>
|
||||
<a title="A self-hosted web radio management suite, including turnkey installer tools and an easy-to-use web app to manage your stations. " href="https://azuracast.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="AzuraCast" src="https://opencollective-production.s3.us-west-1.amazonaws.com/3c12ea10-cdfb-11eb-9cf4-3760b386b76d.png" width="42" height="42"></a>
|
||||
<a title="Triplebyte is the first software engineering job platform that is on the developer's side. Take our coding quiz!" href="https://triplebyte.com/os/opencollective?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Triplebyte" src="https://opencollective-production.s3.us-west-1.amazonaws.com/43e4f9d0-30cd-11ea-9c6b-e1142996e8b2.png" width="42" height="42"></a>
|
||||
<a title="Connect your Collective to GitHub Sponsors: https://docs.opencollective.com/help/collectives/github-sponsors" href="https://github.com/sponsors/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="GitHub Sponsors" src="https://opencollective-production.s3.us-west-1.amazonaws.com/87b1d240-f617-11ea-9960-fd7e8ab20fe4.png" width="48" height="42"></a>
|
||||
<a title="Salesforce" href="https://engineering.salesforce.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Salesforce" src="https://opencollective-production.s3.us-west-1.amazonaws.com/24d34880-df8d-11e9-949c-6bc2037b6bd5.png" width="42" height="42"></a>
|
||||
<!-- </open-collective-sponsors> -->
|
||||
|
||||
[[Become a sponsor via OpenCollective](https://opencollective.com/Carbon#sponsor)]
|
||||
|
||||
<a href="https://github.com/johnrsimeone" target="_blank"><img src="https://avatars.githubusercontent.com/u/22871068?s=70&v=4" width="64" height="64"></a>
|
||||
<a href="https://github.com/taylorotwell" target="_blank"><img src="https://avatars.githubusercontent.com/u/463230?s=128&v=4" width="64" height="64"></a>
|
||||
<a href="https://github.com/usefathom" target="_blank"><img src="https://avatars.githubusercontent.com/u/38684088?s=128&v=4" width="64" height="64"></a>
|
||||
<a href="https://github.com/tobischulz" target="_blank"><img src="https://avatars.githubusercontent.com/u/576014?s=128&v=4" width="64" height="64"></a>
|
||||
<a href="https://github.com/getsentry" target="_blank"><img src="https://avatars.githubusercontent.com/u/1396951?s=128&v=4" width="64" height="64"></a>
|
||||
<a href="https://github.com/codecov" target="_blank"><img src="https://avatars.githubusercontent.com/u/8226205?s=128&v=4" width="64" height="64"></a>
|
||||
|
||||
<a href="https://opencollective.com/Carbon/sponsor/0/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/Carbon/sponsor/1/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/Carbon/sponsor/2/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/Carbon/sponsor/3/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/Carbon/sponsor/4/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/Carbon/sponsor/5/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/Carbon/sponsor/6/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/Carbon/sponsor/7/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/Carbon/sponsor/8/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/8/avatar.svg"></a>
|
||||
|
||||
[[Become a sponsor](https://opencollective.com/Carbon#sponsor)]
|
||||
[[Become a sponsor via GitHub](https://github.com/sponsors/kylekatarnls)]
|
||||
|
||||
### Backers
|
||||
|
||||
Thank you to all our backers! 🙏
|
||||
|
||||
<a href="https://opencollective.com/Carbon#backers" target="_blank"><img src="https://opencollective.com/Carbon/backers.svg?width=890"></a>
|
||||
<a href="https://opencollective.com/Carbon#backers" target="_blank"><img src="https://opencollective.com/Carbon/backers.svg?width=890&version=2023-06-08-07-12"></a>
|
||||
|
||||
[[Become a backer](https://opencollective.com/Carbon#backer)]
|
||||
|
||||
|
||||
Vendored
+120
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Carbon\CarbonImmutable;
|
||||
|
||||
require_once __DIR__.'/vendor/autoload.php';
|
||||
|
||||
function getMaxHistoryMonthsByAmount($amount): int
|
||||
{
|
||||
if ($amount >= 50) {
|
||||
return 6;
|
||||
}
|
||||
|
||||
if ($amount >= 20) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
function getOpenCollectiveSponsors(): string
|
||||
{
|
||||
$customSponsorImages = [
|
||||
// For consistency and equity among sponsors, as of now, we kindly ask our sponsors
|
||||
// to provide an image having a width/height ratio between 1/1 and 2/1.
|
||||
// By default, we'll show the member picture from OpenCollective, and will resize it if bigger
|
||||
// int(OpenCollective.MemberId) => ImageURL
|
||||
];
|
||||
|
||||
$members = json_decode(file_get_contents('https://opencollective.com/carbon/members/all.json'), true);
|
||||
|
||||
$list = array_filter($members, static function ($member): bool {
|
||||
return ($member['lastTransactionAmount'] > 3 || $member['isActive']) &&
|
||||
$member['role'] === 'BACKER' &&
|
||||
$member['type'] !== 'USER' &&
|
||||
(
|
||||
$member['totalAmountDonated'] > 100 ||
|
||||
$member['lastTransactionAt'] > CarbonImmutable::now()
|
||||
->subMonthsNoOverflow(getMaxHistoryMonthsByAmount($member['lastTransactionAmount']))
|
||||
->format('Y-m-d h:i') ||
|
||||
$member['isActive'] && $member['lastTransactionAmount'] >= 30
|
||||
);
|
||||
});
|
||||
|
||||
$list = array_map(static function (array $member): array {
|
||||
$createdAt = CarbonImmutable::parse($member['createdAt']);
|
||||
$lastTransactionAt = CarbonImmutable::parse($member['lastTransactionAt']);
|
||||
|
||||
if ($createdAt->format('d H:i:s.u') > $lastTransactionAt->format('d H:i:s.u')) {
|
||||
$createdAt = $createdAt
|
||||
->setDay($lastTransactionAt->day)
|
||||
->modify($lastTransactionAt->format('H:i:s.u'));
|
||||
}
|
||||
|
||||
$monthlyContribution = (float) ($member['totalAmountDonated'] / ceil($createdAt->floatDiffInMonths()));
|
||||
|
||||
if (
|
||||
$lastTransactionAt->isAfter('last month') &&
|
||||
$member['lastTransactionAmount'] > $monthlyContribution
|
||||
) {
|
||||
$monthlyContribution = (float) $member['lastTransactionAmount'];
|
||||
}
|
||||
|
||||
$yearlyContribution = (float) ($member['totalAmountDonated'] / max(1, $createdAt->floatDiffInYears()));
|
||||
$status = null;
|
||||
|
||||
if ($monthlyContribution > 29) {
|
||||
$status = 'sponsor';
|
||||
} elseif ($monthlyContribution > 4.5 || $yearlyContribution > 29) {
|
||||
$status = 'backer';
|
||||
} elseif ($member['totalAmountDonated'] > 0) {
|
||||
$status = 'helper';
|
||||
}
|
||||
|
||||
return array_merge($member, [
|
||||
'star' => ($monthlyContribution > 98 || $yearlyContribution > 500),
|
||||
'status' => $status,
|
||||
'monthlyContribution' => $monthlyContribution,
|
||||
'yearlyContribution' => $yearlyContribution,
|
||||
]);
|
||||
}, $list);
|
||||
|
||||
usort($list, static function (array $a, array $b): int {
|
||||
return ($b['monthlyContribution'] <=> $a['monthlyContribution'])
|
||||
?: ($b['totalAmountDonated'] <=> $a['totalAmountDonated']);
|
||||
});
|
||||
|
||||
return implode('', array_map(static function (array $member) use ($customSponsorImages): string {
|
||||
$href = htmlspecialchars($member['website'] ?? $member['profile']);
|
||||
$src = $customSponsorImages[$member['MemberId'] ?? ''] ?? $member['image'] ?? (strtr($member['profile'], ['https://opencollective.com/' => 'https://images.opencollective.com/']).'/avatar/256.png');
|
||||
[$x, $y] = @getimagesize($src) ?: [0, 0];
|
||||
$validImage = ($x && $y);
|
||||
$src = $validImage ? htmlspecialchars($src) : 'https://opencollective.com/static/images/default-guest-logo.svg';
|
||||
$height = $member['status'] === 'sponsor' ? 64 : 42;
|
||||
$width = min($height * 2, $validImage ? round($x * $height / $y) : $height);
|
||||
$href .= (strpos($href, '?') === false ? '?' : '&').'utm_source=opencollective&utm_medium=github&utm_campaign=Carbon';
|
||||
$title = htmlspecialchars(($member['description'] ?? null) ?: $member['name']);
|
||||
$alt = htmlspecialchars($member['name']);
|
||||
|
||||
return "\n".'<a title="'.$title.'" href="'.$href.'" target="_blank">'.
|
||||
'<img alt="'.$alt.'" src="'.$src.'" width="'.$width.'" height="'.$height.'">'.
|
||||
'</a>';
|
||||
}, $list))."\n";
|
||||
}
|
||||
|
||||
file_put_contents('readme.md', preg_replace_callback(
|
||||
'/(<!-- <open-collective-sponsors> -->)[\s\S]+(<!-- <\/open-collective-sponsors> -->)/',
|
||||
static function (array $match): string {
|
||||
return $match[1].getOpenCollectiveSponsors().$match[2];
|
||||
},
|
||||
file_get_contents('readme.md')
|
||||
));
|
||||
+3
-2
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace Carbon;
|
||||
|
||||
use Carbon\MessageFormatter\MessageFormatterMapper;
|
||||
use Closure;
|
||||
use ReflectionException;
|
||||
use ReflectionFunction;
|
||||
@@ -51,7 +52,7 @@ abstract class AbstractTranslator extends Translation\Translator
|
||||
/**
|
||||
* List of locales aliases.
|
||||
*
|
||||
* @var string[]
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $aliases = [
|
||||
'me' => 'sr_Latn_ME',
|
||||
@@ -83,7 +84,7 @@ abstract class AbstractTranslator extends Translation\Translator
|
||||
$this->initializing = true;
|
||||
$this->directories = [__DIR__.'/Lang'];
|
||||
$this->addLoader('array', new ArrayLoader());
|
||||
parent::__construct($locale, $formatter, $cacheDir, $debug);
|
||||
parent::__construct($locale, new MessageFormatterMapper($formatter), $cacheDir, $debug);
|
||||
$this->initializing = false;
|
||||
}
|
||||
|
||||
|
||||
+467
-467
@@ -33,477 +33,477 @@ use DateTimeZone;
|
||||
* @property int $second
|
||||
* @property int $micro
|
||||
* @property int $microsecond
|
||||
* @property int|float|string $timestamp seconds since the Unix Epoch
|
||||
* @property string $englishDayOfWeek the day of week in English
|
||||
* @property string $shortEnglishDayOfWeek the abbreviated day of week in English
|
||||
* @property string $englishMonth the month in English
|
||||
* @property string $shortEnglishMonth the abbreviated month in English
|
||||
* @property int|float|string $timestamp seconds since the Unix Epoch
|
||||
* @property string $englishDayOfWeek the day of week in English
|
||||
* @property string $shortEnglishDayOfWeek the abbreviated day of week in English
|
||||
* @property string $englishMonth the month in English
|
||||
* @property string $shortEnglishMonth the abbreviated month in English
|
||||
* @property int $milliseconds
|
||||
* @property int $millisecond
|
||||
* @property int $milli
|
||||
* @property int $week 1 through 53
|
||||
* @property int $isoWeek 1 through 53
|
||||
* @property int $weekYear year according to week format
|
||||
* @property int $isoWeekYear year according to ISO week format
|
||||
* @property int $dayOfYear 1 through 366
|
||||
* @property int $age does a diffInYears() with default parameters
|
||||
* @property int $offset the timezone offset in seconds from UTC
|
||||
* @property int $offsetMinutes the timezone offset in minutes from UTC
|
||||
* @property int $offsetHours the timezone offset in hours from UTC
|
||||
* @property CarbonTimeZone $timezone the current timezone
|
||||
* @property CarbonTimeZone $tz alias of $timezone
|
||||
* @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday)
|
||||
* @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday)
|
||||
* @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday
|
||||
* @property-read int $daysInMonth number of days in the given month
|
||||
* @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark)
|
||||
* @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark)
|
||||
* @property-read string $timezoneAbbreviatedName the current timezone abbreviated name
|
||||
* @property-read string $tzAbbrName alias of $timezoneAbbreviatedName
|
||||
* @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
|
||||
* @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
|
||||
* @property-read int $noZeroHour current hour from 1 to 24
|
||||
* @property-read int $weeksInYear 51 through 53
|
||||
* @property-read int $isoWeeksInYear 51 through 53
|
||||
* @property-read int $weekOfMonth 1 through 5
|
||||
* @property-read int $weekNumberInMonth 1 through 5
|
||||
* @property-read int $firstWeekDay 0 through 6
|
||||
* @property-read int $lastWeekDay 0 through 6
|
||||
* @property-read int $daysInYear 365 or 366
|
||||
* @property-read int $quarter the quarter of this instance, 1 - 4
|
||||
* @property-read int $decade the decade of this instance
|
||||
* @property-read int $century the century of this instance
|
||||
* @property-read int $millennium the millennium of this instance
|
||||
* @property-read bool $dst daylight savings time indicator, true if DST, false otherwise
|
||||
* @property-read bool $local checks if the timezone is local, true if local, false otherwise
|
||||
* @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise
|
||||
* @property-read string $timezoneName the current timezone name
|
||||
* @property-read string $tzName alias of $timezoneName
|
||||
* @property-read string $locale locale of the current instance
|
||||
* @property int $week 1 through 53
|
||||
* @property int $isoWeek 1 through 53
|
||||
* @property int $weekYear year according to week format
|
||||
* @property int $isoWeekYear year according to ISO week format
|
||||
* @property int $dayOfYear 1 through 366
|
||||
* @property int $age does a diffInYears() with default parameters
|
||||
* @property int $offset the timezone offset in seconds from UTC
|
||||
* @property int $offsetMinutes the timezone offset in minutes from UTC
|
||||
* @property int $offsetHours the timezone offset in hours from UTC
|
||||
* @property CarbonTimeZone $timezone the current timezone
|
||||
* @property CarbonTimeZone $tz alias of $timezone
|
||||
* @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday)
|
||||
* @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday)
|
||||
* @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday
|
||||
* @property-read int $daysInMonth number of days in the given month
|
||||
* @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark)
|
||||
* @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark)
|
||||
* @property-read string $timezoneAbbreviatedName the current timezone abbreviated name
|
||||
* @property-read string $tzAbbrName alias of $timezoneAbbreviatedName
|
||||
* @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
|
||||
* @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
|
||||
* @property-read int $noZeroHour current hour from 1 to 24
|
||||
* @property-read int $weeksInYear 51 through 53
|
||||
* @property-read int $isoWeeksInYear 51 through 53
|
||||
* @property-read int $weekOfMonth 1 through 5
|
||||
* @property-read int $weekNumberInMonth 1 through 5
|
||||
* @property-read int $firstWeekDay 0 through 6
|
||||
* @property-read int $lastWeekDay 0 through 6
|
||||
* @property-read int $daysInYear 365 or 366
|
||||
* @property-read int $quarter the quarter of this instance, 1 - 4
|
||||
* @property-read int $decade the decade of this instance
|
||||
* @property-read int $century the century of this instance
|
||||
* @property-read int $millennium the millennium of this instance
|
||||
* @property-read bool $dst daylight savings time indicator, true if DST, false otherwise
|
||||
* @property-read bool $local checks if the timezone is local, true if local, false otherwise
|
||||
* @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise
|
||||
* @property-read string $timezoneName the current timezone name
|
||||
* @property-read string $tzName alias of $timezoneName
|
||||
* @property-read string $locale locale of the current instance
|
||||
*
|
||||
* @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.)
|
||||
* @method bool isLocal() Check if the current instance has non-UTC timezone.
|
||||
* @method bool isValid() Check if the current instance is a valid date.
|
||||
* @method bool isDST() Check if the current instance is in a daylight saving time.
|
||||
* @method bool isSunday() Checks if the instance day is sunday.
|
||||
* @method bool isMonday() Checks if the instance day is monday.
|
||||
* @method bool isTuesday() Checks if the instance day is tuesday.
|
||||
* @method bool isWednesday() Checks if the instance day is wednesday.
|
||||
* @method bool isThursday() Checks if the instance day is thursday.
|
||||
* @method bool isFriday() Checks if the instance day is friday.
|
||||
* @method bool isSaturday() Checks if the instance day is saturday.
|
||||
* @method bool isSameYear(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentYear() Checks if the instance is in the same year as the current moment.
|
||||
* @method bool isNextYear() Checks if the instance is in the same year as the current moment next year.
|
||||
* @method bool isLastYear() Checks if the instance is in the same year as the current moment last year.
|
||||
* @method bool isSameWeek(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment.
|
||||
* @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week.
|
||||
* @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week.
|
||||
* @method bool isSameDay(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentDay() Checks if the instance is in the same day as the current moment.
|
||||
* @method bool isNextDay() Checks if the instance is in the same day as the current moment next day.
|
||||
* @method bool isLastDay() Checks if the instance is in the same day as the current moment last day.
|
||||
* @method bool isSameHour(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment.
|
||||
* @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour.
|
||||
* @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour.
|
||||
* @method bool isSameMinute(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment.
|
||||
* @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute.
|
||||
* @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute.
|
||||
* @method bool isSameSecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment.
|
||||
* @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second.
|
||||
* @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second.
|
||||
* @method bool isSameMicro(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment.
|
||||
* @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond.
|
||||
* @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond.
|
||||
* @method bool isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment.
|
||||
* @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond.
|
||||
* @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond.
|
||||
* @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment.
|
||||
* @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month.
|
||||
* @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month.
|
||||
* @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment.
|
||||
* @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter.
|
||||
* @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter.
|
||||
* @method bool isSameDecade(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment.
|
||||
* @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade.
|
||||
* @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade.
|
||||
* @method bool isSameCentury(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment.
|
||||
* @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century.
|
||||
* @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century.
|
||||
* @method bool isSameMillennium(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment.
|
||||
* @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium.
|
||||
* @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium.
|
||||
* @method $this years(int $value) Set current instance year to the given value.
|
||||
* @method $this year(int $value) Set current instance year to the given value.
|
||||
* @method $this setYears(int $value) Set current instance year to the given value.
|
||||
* @method $this setYear(int $value) Set current instance year to the given value.
|
||||
* @method $this months(int $value) Set current instance month to the given value.
|
||||
* @method $this month(int $value) Set current instance month to the given value.
|
||||
* @method $this setMonths(int $value) Set current instance month to the given value.
|
||||
* @method $this setMonth(int $value) Set current instance month to the given value.
|
||||
* @method $this days(int $value) Set current instance day to the given value.
|
||||
* @method $this day(int $value) Set current instance day to the given value.
|
||||
* @method $this setDays(int $value) Set current instance day to the given value.
|
||||
* @method $this setDay(int $value) Set current instance day to the given value.
|
||||
* @method $this hours(int $value) Set current instance hour to the given value.
|
||||
* @method $this hour(int $value) Set current instance hour to the given value.
|
||||
* @method $this setHours(int $value) Set current instance hour to the given value.
|
||||
* @method $this setHour(int $value) Set current instance hour to the given value.
|
||||
* @method $this minutes(int $value) Set current instance minute to the given value.
|
||||
* @method $this minute(int $value) Set current instance minute to the given value.
|
||||
* @method $this setMinutes(int $value) Set current instance minute to the given value.
|
||||
* @method $this setMinute(int $value) Set current instance minute to the given value.
|
||||
* @method $this seconds(int $value) Set current instance second to the given value.
|
||||
* @method $this second(int $value) Set current instance second to the given value.
|
||||
* @method $this setSeconds(int $value) Set current instance second to the given value.
|
||||
* @method $this setSecond(int $value) Set current instance second to the given value.
|
||||
* @method $this millis(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this milli(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this setMillis(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this setMilli(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this milliseconds(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this millisecond(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this setMilliseconds(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this setMillisecond(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this micros(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this micro(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this setMicros(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this setMicro(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this microseconds(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this microsecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this setMicroseconds(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this setMicrosecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addYear() Add one year to the instance (using date interval).
|
||||
* @method $this subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subYear() Sub one year to the instance (using date interval).
|
||||
* @method $this addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMonth() Add one month to the instance (using date interval).
|
||||
* @method $this subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMonth() Sub one month to the instance (using date interval).
|
||||
* @method $this addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addDay() Add one day to the instance (using date interval).
|
||||
* @method $this subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subDay() Sub one day to the instance (using date interval).
|
||||
* @method $this addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addHour() Add one hour to the instance (using date interval).
|
||||
* @method $this subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subHour() Sub one hour to the instance (using date interval).
|
||||
* @method $this addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMinute() Add one minute to the instance (using date interval).
|
||||
* @method $this subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMinute() Sub one minute to the instance (using date interval).
|
||||
* @method $this addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addSecond() Add one second to the instance (using date interval).
|
||||
* @method $this subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subSecond() Sub one second to the instance (using date interval).
|
||||
* @method $this addMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMilli() Add one millisecond to the instance (using date interval).
|
||||
* @method $this subMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMilli() Sub one millisecond to the instance (using date interval).
|
||||
* @method $this addMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMillisecond() Add one millisecond to the instance (using date interval).
|
||||
* @method $this subMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMillisecond() Sub one millisecond to the instance (using date interval).
|
||||
* @method $this addMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMicro() Add one microsecond to the instance (using date interval).
|
||||
* @method $this subMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMicro() Sub one microsecond to the instance (using date interval).
|
||||
* @method $this addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMicrosecond() Add one microsecond to the instance (using date interval).
|
||||
* @method $this subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMicrosecond() Sub one microsecond to the instance (using date interval).
|
||||
* @method $this addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMillennium() Add one millennium to the instance (using date interval).
|
||||
* @method $this subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMillennium() Sub one millennium to the instance (using date interval).
|
||||
* @method $this addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addCentury() Add one century to the instance (using date interval).
|
||||
* @method $this subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subCentury() Sub one century to the instance (using date interval).
|
||||
* @method $this addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addDecade() Add one decade to the instance (using date interval).
|
||||
* @method $this subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subDecade() Sub one decade to the instance (using date interval).
|
||||
* @method $this addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addQuarter() Add one quarter to the instance (using date interval).
|
||||
* @method $this subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subQuarter() Sub one quarter to the instance (using date interval).
|
||||
* @method $this addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addWeek() Add one week to the instance (using date interval).
|
||||
* @method $this subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subWeek() Sub one week to the instance (using date interval).
|
||||
* @method $this addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addWeekday() Add one weekday to the instance (using date interval).
|
||||
* @method $this subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subWeekday() Sub one weekday to the instance (using date interval).
|
||||
* @method $this addRealMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMicro() Add one microsecond to the instance (using timestamp).
|
||||
* @method $this subRealMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMicro() Sub one microsecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod microsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
|
||||
* @method $this addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMicrosecond() Add one microsecond to the instance (using timestamp).
|
||||
* @method $this subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMicrosecond() Sub one microsecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod microsecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
|
||||
* @method $this addRealMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMilli() Add one millisecond to the instance (using timestamp).
|
||||
* @method $this subRealMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMilli() Sub one millisecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod millisUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
|
||||
* @method $this addRealMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMillisecond() Add one millisecond to the instance (using timestamp).
|
||||
* @method $this subRealMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMillisecond() Sub one millisecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod millisecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
|
||||
* @method $this addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealSecond() Add one second to the instance (using timestamp).
|
||||
* @method $this subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealSecond() Sub one second to the instance (using timestamp).
|
||||
* @method CarbonPeriod secondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given.
|
||||
* @method $this addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMinute() Add one minute to the instance (using timestamp).
|
||||
* @method $this subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMinute() Sub one minute to the instance (using timestamp).
|
||||
* @method CarbonPeriod minutesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given.
|
||||
* @method $this addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealHour() Add one hour to the instance (using timestamp).
|
||||
* @method $this subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealHour() Sub one hour to the instance (using timestamp).
|
||||
* @method CarbonPeriod hoursUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given.
|
||||
* @method $this addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealDay() Add one day to the instance (using timestamp).
|
||||
* @method $this subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealDay() Sub one day to the instance (using timestamp).
|
||||
* @method CarbonPeriod daysUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given.
|
||||
* @method $this addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealWeek() Add one week to the instance (using timestamp).
|
||||
* @method $this subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealWeek() Sub one week to the instance (using timestamp).
|
||||
* @method CarbonPeriod weeksUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given.
|
||||
* @method $this addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMonth() Add one month to the instance (using timestamp).
|
||||
* @method $this subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMonth() Sub one month to the instance (using timestamp).
|
||||
* @method CarbonPeriod monthsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given.
|
||||
* @method $this addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealQuarter() Add one quarter to the instance (using timestamp).
|
||||
* @method $this subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealQuarter() Sub one quarter to the instance (using timestamp).
|
||||
* @method CarbonPeriod quartersUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given.
|
||||
* @method $this addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealYear() Add one year to the instance (using timestamp).
|
||||
* @method $this subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealYear() Sub one year to the instance (using timestamp).
|
||||
* @method CarbonPeriod yearsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given.
|
||||
* @method $this addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealDecade() Add one decade to the instance (using timestamp).
|
||||
* @method $this subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealDecade() Sub one decade to the instance (using timestamp).
|
||||
* @method CarbonPeriod decadesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given.
|
||||
* @method $this addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealCentury() Add one century to the instance (using timestamp).
|
||||
* @method $this subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealCentury() Sub one century to the instance (using timestamp).
|
||||
* @method CarbonPeriod centuriesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given.
|
||||
* @method $this addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMillennium() Add one millennium to the instance (using timestamp).
|
||||
* @method $this subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMillennium() Sub one millennium to the instance (using timestamp).
|
||||
* @method CarbonPeriod millenniaUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given.
|
||||
* @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
|
||||
* @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
|
||||
* @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision.
|
||||
* @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision.
|
||||
* @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision.
|
||||
* @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision.
|
||||
* @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
|
||||
* @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
|
||||
* @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision.
|
||||
* @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision.
|
||||
* @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision.
|
||||
* @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision.
|
||||
* @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
|
||||
* @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
|
||||
* @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision.
|
||||
* @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision.
|
||||
* @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision.
|
||||
* @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision.
|
||||
* @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
|
||||
* @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
|
||||
* @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision.
|
||||
* @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision.
|
||||
* @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision.
|
||||
* @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision.
|
||||
* @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
|
||||
* @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
|
||||
* @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision.
|
||||
* @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision.
|
||||
* @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision.
|
||||
* @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision.
|
||||
* @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
|
||||
* @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
|
||||
* @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision.
|
||||
* @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision.
|
||||
* @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision.
|
||||
* @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision.
|
||||
* @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
|
||||
* @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
|
||||
* @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision.
|
||||
* @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision.
|
||||
* @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision.
|
||||
* @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision.
|
||||
* @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
|
||||
* @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
|
||||
* @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision.
|
||||
* @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision.
|
||||
* @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision.
|
||||
* @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision.
|
||||
* @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
|
||||
* @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
|
||||
* @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision.
|
||||
* @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision.
|
||||
* @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision.
|
||||
* @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision.
|
||||
* @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
|
||||
* @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
|
||||
* @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision.
|
||||
* @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision.
|
||||
* @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision.
|
||||
* @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision.
|
||||
* @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
|
||||
* @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
|
||||
* @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision.
|
||||
* @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision.
|
||||
* @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision.
|
||||
* @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision.
|
||||
* @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
|
||||
* @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
|
||||
* @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision.
|
||||
* @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision.
|
||||
* @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision.
|
||||
* @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision.
|
||||
* @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method static Carbon|false createFromFormat(string $format, string $time, string|DateTimeZone $timezone = null) Parse a string into a new Carbon object according to the specified format.
|
||||
* @method static Carbon __set_state(array $array) https://php.net/manual/en/datetime.set-state.php
|
||||
* @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.)
|
||||
* @method bool isLocal() Check if the current instance has non-UTC timezone.
|
||||
* @method bool isValid() Check if the current instance is a valid date.
|
||||
* @method bool isDST() Check if the current instance is in a daylight saving time.
|
||||
* @method bool isSunday() Checks if the instance day is sunday.
|
||||
* @method bool isMonday() Checks if the instance day is monday.
|
||||
* @method bool isTuesday() Checks if the instance day is tuesday.
|
||||
* @method bool isWednesday() Checks if the instance day is wednesday.
|
||||
* @method bool isThursday() Checks if the instance day is thursday.
|
||||
* @method bool isFriday() Checks if the instance day is friday.
|
||||
* @method bool isSaturday() Checks if the instance day is saturday.
|
||||
* @method bool isSameYear(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentYear() Checks if the instance is in the same year as the current moment.
|
||||
* @method bool isNextYear() Checks if the instance is in the same year as the current moment next year.
|
||||
* @method bool isLastYear() Checks if the instance is in the same year as the current moment last year.
|
||||
* @method bool isSameWeek(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment.
|
||||
* @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week.
|
||||
* @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week.
|
||||
* @method bool isSameDay(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentDay() Checks if the instance is in the same day as the current moment.
|
||||
* @method bool isNextDay() Checks if the instance is in the same day as the current moment next day.
|
||||
* @method bool isLastDay() Checks if the instance is in the same day as the current moment last day.
|
||||
* @method bool isSameHour(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment.
|
||||
* @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour.
|
||||
* @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour.
|
||||
* @method bool isSameMinute(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment.
|
||||
* @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute.
|
||||
* @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute.
|
||||
* @method bool isSameSecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment.
|
||||
* @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second.
|
||||
* @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second.
|
||||
* @method bool isSameMicro(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment.
|
||||
* @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond.
|
||||
* @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond.
|
||||
* @method bool isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment.
|
||||
* @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond.
|
||||
* @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond.
|
||||
* @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment.
|
||||
* @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month.
|
||||
* @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month.
|
||||
* @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment.
|
||||
* @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter.
|
||||
* @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter.
|
||||
* @method bool isSameDecade(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment.
|
||||
* @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade.
|
||||
* @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade.
|
||||
* @method bool isSameCentury(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment.
|
||||
* @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century.
|
||||
* @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century.
|
||||
* @method bool isSameMillennium(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment.
|
||||
* @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium.
|
||||
* @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium.
|
||||
* @method $this years(int $value) Set current instance year to the given value.
|
||||
* @method $this year(int $value) Set current instance year to the given value.
|
||||
* @method $this setYears(int $value) Set current instance year to the given value.
|
||||
* @method $this setYear(int $value) Set current instance year to the given value.
|
||||
* @method $this months(int $value) Set current instance month to the given value.
|
||||
* @method $this month(int $value) Set current instance month to the given value.
|
||||
* @method $this setMonths(int $value) Set current instance month to the given value.
|
||||
* @method $this setMonth(int $value) Set current instance month to the given value.
|
||||
* @method $this days(int $value) Set current instance day to the given value.
|
||||
* @method $this day(int $value) Set current instance day to the given value.
|
||||
* @method $this setDays(int $value) Set current instance day to the given value.
|
||||
* @method $this setDay(int $value) Set current instance day to the given value.
|
||||
* @method $this hours(int $value) Set current instance hour to the given value.
|
||||
* @method $this hour(int $value) Set current instance hour to the given value.
|
||||
* @method $this setHours(int $value) Set current instance hour to the given value.
|
||||
* @method $this setHour(int $value) Set current instance hour to the given value.
|
||||
* @method $this minutes(int $value) Set current instance minute to the given value.
|
||||
* @method $this minute(int $value) Set current instance minute to the given value.
|
||||
* @method $this setMinutes(int $value) Set current instance minute to the given value.
|
||||
* @method $this setMinute(int $value) Set current instance minute to the given value.
|
||||
* @method $this seconds(int $value) Set current instance second to the given value.
|
||||
* @method $this second(int $value) Set current instance second to the given value.
|
||||
* @method $this setSeconds(int $value) Set current instance second to the given value.
|
||||
* @method $this setSecond(int $value) Set current instance second to the given value.
|
||||
* @method $this millis(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this milli(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this setMillis(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this setMilli(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this milliseconds(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this millisecond(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this setMilliseconds(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this setMillisecond(int $value) Set current instance millisecond to the given value.
|
||||
* @method $this micros(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this micro(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this setMicros(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this setMicro(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this microseconds(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this microsecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this setMicroseconds(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this setMicrosecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addYear() Add one year to the instance (using date interval).
|
||||
* @method $this subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subYear() Sub one year to the instance (using date interval).
|
||||
* @method $this addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMonth() Add one month to the instance (using date interval).
|
||||
* @method $this subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMonth() Sub one month to the instance (using date interval).
|
||||
* @method $this addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addDay() Add one day to the instance (using date interval).
|
||||
* @method $this subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subDay() Sub one day to the instance (using date interval).
|
||||
* @method $this addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addHour() Add one hour to the instance (using date interval).
|
||||
* @method $this subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subHour() Sub one hour to the instance (using date interval).
|
||||
* @method $this addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMinute() Add one minute to the instance (using date interval).
|
||||
* @method $this subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMinute() Sub one minute to the instance (using date interval).
|
||||
* @method $this addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addSecond() Add one second to the instance (using date interval).
|
||||
* @method $this subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subSecond() Sub one second to the instance (using date interval).
|
||||
* @method $this addMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMilli() Add one millisecond to the instance (using date interval).
|
||||
* @method $this subMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMilli() Sub one millisecond to the instance (using date interval).
|
||||
* @method $this addMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMillisecond() Add one millisecond to the instance (using date interval).
|
||||
* @method $this subMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMillisecond() Sub one millisecond to the instance (using date interval).
|
||||
* @method $this addMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMicro() Add one microsecond to the instance (using date interval).
|
||||
* @method $this subMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMicro() Sub one microsecond to the instance (using date interval).
|
||||
* @method $this addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMicrosecond() Add one microsecond to the instance (using date interval).
|
||||
* @method $this subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMicrosecond() Sub one microsecond to the instance (using date interval).
|
||||
* @method $this addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addMillennium() Add one millennium to the instance (using date interval).
|
||||
* @method $this subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subMillennium() Sub one millennium to the instance (using date interval).
|
||||
* @method $this addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addCentury() Add one century to the instance (using date interval).
|
||||
* @method $this subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subCentury() Sub one century to the instance (using date interval).
|
||||
* @method $this addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addDecade() Add one decade to the instance (using date interval).
|
||||
* @method $this subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subDecade() Sub one decade to the instance (using date interval).
|
||||
* @method $this addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addQuarter() Add one quarter to the instance (using date interval).
|
||||
* @method $this subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subQuarter() Sub one quarter to the instance (using date interval).
|
||||
* @method $this addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method $this addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method $this addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addWeek() Add one week to the instance (using date interval).
|
||||
* @method $this subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subWeek() Sub one week to the instance (using date interval).
|
||||
* @method $this addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this addWeekday() Add one weekday to the instance (using date interval).
|
||||
* @method $this subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval).
|
||||
* @method $this subWeekday() Sub one weekday to the instance (using date interval).
|
||||
* @method $this addRealMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMicro() Add one microsecond to the instance (using timestamp).
|
||||
* @method $this subRealMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMicro() Sub one microsecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod microsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
|
||||
* @method $this addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMicrosecond() Add one microsecond to the instance (using timestamp).
|
||||
* @method $this subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMicrosecond() Sub one microsecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod microsecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
|
||||
* @method $this addRealMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMilli() Add one millisecond to the instance (using timestamp).
|
||||
* @method $this subRealMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMilli() Sub one millisecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod millisUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
|
||||
* @method $this addRealMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMillisecond() Add one millisecond to the instance (using timestamp).
|
||||
* @method $this subRealMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMillisecond() Sub one millisecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod millisecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
|
||||
* @method $this addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealSecond() Add one second to the instance (using timestamp).
|
||||
* @method $this subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealSecond() Sub one second to the instance (using timestamp).
|
||||
* @method CarbonPeriod secondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given.
|
||||
* @method $this addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMinute() Add one minute to the instance (using timestamp).
|
||||
* @method $this subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMinute() Sub one minute to the instance (using timestamp).
|
||||
* @method CarbonPeriod minutesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given.
|
||||
* @method $this addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealHour() Add one hour to the instance (using timestamp).
|
||||
* @method $this subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealHour() Sub one hour to the instance (using timestamp).
|
||||
* @method CarbonPeriod hoursUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given.
|
||||
* @method $this addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealDay() Add one day to the instance (using timestamp).
|
||||
* @method $this subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealDay() Sub one day to the instance (using timestamp).
|
||||
* @method CarbonPeriod daysUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given.
|
||||
* @method $this addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealWeek() Add one week to the instance (using timestamp).
|
||||
* @method $this subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealWeek() Sub one week to the instance (using timestamp).
|
||||
* @method CarbonPeriod weeksUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given.
|
||||
* @method $this addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMonth() Add one month to the instance (using timestamp).
|
||||
* @method $this subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMonth() Sub one month to the instance (using timestamp).
|
||||
* @method CarbonPeriod monthsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given.
|
||||
* @method $this addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealQuarter() Add one quarter to the instance (using timestamp).
|
||||
* @method $this subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealQuarter() Sub one quarter to the instance (using timestamp).
|
||||
* @method CarbonPeriod quartersUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given.
|
||||
* @method $this addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealYear() Add one year to the instance (using timestamp).
|
||||
* @method $this subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealYear() Sub one year to the instance (using timestamp).
|
||||
* @method CarbonPeriod yearsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given.
|
||||
* @method $this addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealDecade() Add one decade to the instance (using timestamp).
|
||||
* @method $this subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealDecade() Sub one decade to the instance (using timestamp).
|
||||
* @method CarbonPeriod decadesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given.
|
||||
* @method $this addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealCentury() Add one century to the instance (using timestamp).
|
||||
* @method $this subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealCentury() Sub one century to the instance (using timestamp).
|
||||
* @method CarbonPeriod centuriesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given.
|
||||
* @method $this addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this addRealMillennium() Add one millennium to the instance (using timestamp).
|
||||
* @method $this subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp).
|
||||
* @method $this subRealMillennium() Sub one millennium to the instance (using timestamp).
|
||||
* @method CarbonPeriod millenniaUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given.
|
||||
* @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
|
||||
* @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
|
||||
* @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision.
|
||||
* @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision.
|
||||
* @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision.
|
||||
* @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision.
|
||||
* @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
|
||||
* @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
|
||||
* @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision.
|
||||
* @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision.
|
||||
* @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision.
|
||||
* @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision.
|
||||
* @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
|
||||
* @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
|
||||
* @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision.
|
||||
* @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision.
|
||||
* @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision.
|
||||
* @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision.
|
||||
* @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
|
||||
* @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
|
||||
* @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision.
|
||||
* @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision.
|
||||
* @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision.
|
||||
* @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision.
|
||||
* @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
|
||||
* @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
|
||||
* @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision.
|
||||
* @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision.
|
||||
* @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision.
|
||||
* @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision.
|
||||
* @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
|
||||
* @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
|
||||
* @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision.
|
||||
* @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision.
|
||||
* @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision.
|
||||
* @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision.
|
||||
* @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
|
||||
* @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
|
||||
* @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision.
|
||||
* @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision.
|
||||
* @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision.
|
||||
* @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision.
|
||||
* @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
|
||||
* @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
|
||||
* @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision.
|
||||
* @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision.
|
||||
* @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision.
|
||||
* @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision.
|
||||
* @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
|
||||
* @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
|
||||
* @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision.
|
||||
* @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision.
|
||||
* @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision.
|
||||
* @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision.
|
||||
* @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
|
||||
* @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
|
||||
* @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision.
|
||||
* @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision.
|
||||
* @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision.
|
||||
* @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision.
|
||||
* @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
|
||||
* @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
|
||||
* @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision.
|
||||
* @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision.
|
||||
* @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision.
|
||||
* @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision.
|
||||
* @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
|
||||
* @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
|
||||
* @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision.
|
||||
* @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision.
|
||||
* @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision.
|
||||
* @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision.
|
||||
* @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method static static|false createFromFormat(string $format, string $time, DateTimeZone|string|false|null $timezone = null) Parse a string into a new Carbon object according to the specified format.
|
||||
* @method static static __set_state(array $array) https://php.net/manual/en/datetime.set-state.php
|
||||
*
|
||||
* </autodoc>
|
||||
*/
|
||||
|
||||
+479
-479
@@ -24,486 +24,486 @@ use DateTimeZone;
|
||||
*
|
||||
* <autodoc generated by `composer phpdoc`>
|
||||
*
|
||||
* @property int $year
|
||||
* @property int $yearIso
|
||||
* @property int $month
|
||||
* @property int $day
|
||||
* @property int $hour
|
||||
* @property int $minute
|
||||
* @property int $second
|
||||
* @property int $micro
|
||||
* @property int $microsecond
|
||||
* @property int|float|string $timestamp seconds since the Unix Epoch
|
||||
* @property string $englishDayOfWeek the day of week in English
|
||||
* @property string $shortEnglishDayOfWeek the abbreviated day of week in English
|
||||
* @property string $englishMonth the month in English
|
||||
* @property string $shortEnglishMonth the abbreviated month in English
|
||||
* @property int $milliseconds
|
||||
* @property int $millisecond
|
||||
* @property int $milli
|
||||
* @property int $week 1 through 53
|
||||
* @property int $isoWeek 1 through 53
|
||||
* @property int $weekYear year according to week format
|
||||
* @property int $isoWeekYear year according to ISO week format
|
||||
* @property int $dayOfYear 1 through 366
|
||||
* @property int $age does a diffInYears() with default parameters
|
||||
* @property int $offset the timezone offset in seconds from UTC
|
||||
* @property int $offsetMinutes the timezone offset in minutes from UTC
|
||||
* @property int $offsetHours the timezone offset in hours from UTC
|
||||
* @property CarbonTimeZone $timezone the current timezone
|
||||
* @property CarbonTimeZone $tz alias of $timezone
|
||||
* @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday)
|
||||
* @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday)
|
||||
* @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday
|
||||
* @property-read int $daysInMonth number of days in the given month
|
||||
* @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark)
|
||||
* @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark)
|
||||
* @property-read string $timezoneAbbreviatedName the current timezone abbreviated name
|
||||
* @property-read string $tzAbbrName alias of $timezoneAbbreviatedName
|
||||
* @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
|
||||
* @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
|
||||
* @property-read int $noZeroHour current hour from 1 to 24
|
||||
* @property-read int $weeksInYear 51 through 53
|
||||
* @property-read int $isoWeeksInYear 51 through 53
|
||||
* @property-read int $weekOfMonth 1 through 5
|
||||
* @property-read int $weekNumberInMonth 1 through 5
|
||||
* @property-read int $firstWeekDay 0 through 6
|
||||
* @property-read int $lastWeekDay 0 through 6
|
||||
* @property-read int $daysInYear 365 or 366
|
||||
* @property-read int $quarter the quarter of this instance, 1 - 4
|
||||
* @property-read int $decade the decade of this instance
|
||||
* @property-read int $century the century of this instance
|
||||
* @property-read int $millennium the millennium of this instance
|
||||
* @property-read bool $dst daylight savings time indicator, true if DST, false otherwise
|
||||
* @property-read bool $local checks if the timezone is local, true if local, false otherwise
|
||||
* @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise
|
||||
* @property-read string $timezoneName the current timezone name
|
||||
* @property-read string $tzName alias of $timezoneName
|
||||
* @property-read string $locale locale of the current instance
|
||||
* @property int $year
|
||||
* @property int $yearIso
|
||||
* @property int $month
|
||||
* @property int $day
|
||||
* @property int $hour
|
||||
* @property int $minute
|
||||
* @property int $second
|
||||
* @property int $micro
|
||||
* @property int $microsecond
|
||||
* @property int|float|string $timestamp seconds since the Unix Epoch
|
||||
* @property string $englishDayOfWeek the day of week in English
|
||||
* @property string $shortEnglishDayOfWeek the abbreviated day of week in English
|
||||
* @property string $englishMonth the month in English
|
||||
* @property string $shortEnglishMonth the abbreviated month in English
|
||||
* @property int $milliseconds
|
||||
* @property int $millisecond
|
||||
* @property int $milli
|
||||
* @property int $week 1 through 53
|
||||
* @property int $isoWeek 1 through 53
|
||||
* @property int $weekYear year according to week format
|
||||
* @property int $isoWeekYear year according to ISO week format
|
||||
* @property int $dayOfYear 1 through 366
|
||||
* @property int $age does a diffInYears() with default parameters
|
||||
* @property int $offset the timezone offset in seconds from UTC
|
||||
* @property int $offsetMinutes the timezone offset in minutes from UTC
|
||||
* @property int $offsetHours the timezone offset in hours from UTC
|
||||
* @property CarbonTimeZone $timezone the current timezone
|
||||
* @property CarbonTimeZone $tz alias of $timezone
|
||||
* @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday)
|
||||
* @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday)
|
||||
* @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday
|
||||
* @property-read int $daysInMonth number of days in the given month
|
||||
* @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark)
|
||||
* @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark)
|
||||
* @property-read string $timezoneAbbreviatedName the current timezone abbreviated name
|
||||
* @property-read string $tzAbbrName alias of $timezoneAbbreviatedName
|
||||
* @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language
|
||||
* @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
|
||||
* @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
|
||||
* @property-read int $noZeroHour current hour from 1 to 24
|
||||
* @property-read int $weeksInYear 51 through 53
|
||||
* @property-read int $isoWeeksInYear 51 through 53
|
||||
* @property-read int $weekOfMonth 1 through 5
|
||||
* @property-read int $weekNumberInMonth 1 through 5
|
||||
* @property-read int $firstWeekDay 0 through 6
|
||||
* @property-read int $lastWeekDay 0 through 6
|
||||
* @property-read int $daysInYear 365 or 366
|
||||
* @property-read int $quarter the quarter of this instance, 1 - 4
|
||||
* @property-read int $decade the decade of this instance
|
||||
* @property-read int $century the century of this instance
|
||||
* @property-read int $millennium the millennium of this instance
|
||||
* @property-read bool $dst daylight savings time indicator, true if DST, false otherwise
|
||||
* @property-read bool $local checks if the timezone is local, true if local, false otherwise
|
||||
* @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise
|
||||
* @property-read string $timezoneName the current timezone name
|
||||
* @property-read string $tzName alias of $timezoneName
|
||||
* @property-read string $locale locale of the current instance
|
||||
*
|
||||
* @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.)
|
||||
* @method bool isLocal() Check if the current instance has non-UTC timezone.
|
||||
* @method bool isValid() Check if the current instance is a valid date.
|
||||
* @method bool isDST() Check if the current instance is in a daylight saving time.
|
||||
* @method bool isSunday() Checks if the instance day is sunday.
|
||||
* @method bool isMonday() Checks if the instance day is monday.
|
||||
* @method bool isTuesday() Checks if the instance day is tuesday.
|
||||
* @method bool isWednesday() Checks if the instance day is wednesday.
|
||||
* @method bool isThursday() Checks if the instance day is thursday.
|
||||
* @method bool isFriday() Checks if the instance day is friday.
|
||||
* @method bool isSaturday() Checks if the instance day is saturday.
|
||||
* @method bool isSameYear(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentYear() Checks if the instance is in the same year as the current moment.
|
||||
* @method bool isNextYear() Checks if the instance is in the same year as the current moment next year.
|
||||
* @method bool isLastYear() Checks if the instance is in the same year as the current moment last year.
|
||||
* @method bool isSameWeek(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment.
|
||||
* @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week.
|
||||
* @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week.
|
||||
* @method bool isSameDay(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentDay() Checks if the instance is in the same day as the current moment.
|
||||
* @method bool isNextDay() Checks if the instance is in the same day as the current moment next day.
|
||||
* @method bool isLastDay() Checks if the instance is in the same day as the current moment last day.
|
||||
* @method bool isSameHour(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment.
|
||||
* @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour.
|
||||
* @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour.
|
||||
* @method bool isSameMinute(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment.
|
||||
* @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute.
|
||||
* @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute.
|
||||
* @method bool isSameSecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment.
|
||||
* @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second.
|
||||
* @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second.
|
||||
* @method bool isSameMicro(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment.
|
||||
* @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond.
|
||||
* @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond.
|
||||
* @method bool isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment.
|
||||
* @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond.
|
||||
* @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond.
|
||||
* @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment.
|
||||
* @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month.
|
||||
* @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month.
|
||||
* @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment.
|
||||
* @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter.
|
||||
* @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter.
|
||||
* @method bool isSameDecade(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment.
|
||||
* @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade.
|
||||
* @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade.
|
||||
* @method bool isSameCentury(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment.
|
||||
* @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century.
|
||||
* @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century.
|
||||
* @method bool isSameMillennium(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment.
|
||||
* @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium.
|
||||
* @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium.
|
||||
* @method CarbonImmutable years(int $value) Set current instance year to the given value.
|
||||
* @method CarbonImmutable year(int $value) Set current instance year to the given value.
|
||||
* @method CarbonImmutable setYears(int $value) Set current instance year to the given value.
|
||||
* @method CarbonImmutable setYear(int $value) Set current instance year to the given value.
|
||||
* @method CarbonImmutable months(int $value) Set current instance month to the given value.
|
||||
* @method CarbonImmutable month(int $value) Set current instance month to the given value.
|
||||
* @method CarbonImmutable setMonths(int $value) Set current instance month to the given value.
|
||||
* @method CarbonImmutable setMonth(int $value) Set current instance month to the given value.
|
||||
* @method CarbonImmutable days(int $value) Set current instance day to the given value.
|
||||
* @method CarbonImmutable day(int $value) Set current instance day to the given value.
|
||||
* @method CarbonImmutable setDays(int $value) Set current instance day to the given value.
|
||||
* @method CarbonImmutable setDay(int $value) Set current instance day to the given value.
|
||||
* @method CarbonImmutable hours(int $value) Set current instance hour to the given value.
|
||||
* @method CarbonImmutable hour(int $value) Set current instance hour to the given value.
|
||||
* @method CarbonImmutable setHours(int $value) Set current instance hour to the given value.
|
||||
* @method CarbonImmutable setHour(int $value) Set current instance hour to the given value.
|
||||
* @method CarbonImmutable minutes(int $value) Set current instance minute to the given value.
|
||||
* @method CarbonImmutable minute(int $value) Set current instance minute to the given value.
|
||||
* @method CarbonImmutable setMinutes(int $value) Set current instance minute to the given value.
|
||||
* @method CarbonImmutable setMinute(int $value) Set current instance minute to the given value.
|
||||
* @method CarbonImmutable seconds(int $value) Set current instance second to the given value.
|
||||
* @method CarbonImmutable second(int $value) Set current instance second to the given value.
|
||||
* @method CarbonImmutable setSeconds(int $value) Set current instance second to the given value.
|
||||
* @method CarbonImmutable setSecond(int $value) Set current instance second to the given value.
|
||||
* @method CarbonImmutable millis(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable milli(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable setMillis(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable setMilli(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable milliseconds(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable millisecond(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable setMilliseconds(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable setMillisecond(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable micros(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable micro(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable setMicros(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable setMicro(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable microseconds(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable microsecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable setMicroseconds(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable setMicrosecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addYear() Add one year to the instance (using date interval).
|
||||
* @method CarbonImmutable subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subYear() Sub one year to the instance (using date interval).
|
||||
* @method CarbonImmutable addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMonth() Add one month to the instance (using date interval).
|
||||
* @method CarbonImmutable subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMonth() Sub one month to the instance (using date interval).
|
||||
* @method CarbonImmutable addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addDay() Add one day to the instance (using date interval).
|
||||
* @method CarbonImmutable subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subDay() Sub one day to the instance (using date interval).
|
||||
* @method CarbonImmutable addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addHour() Add one hour to the instance (using date interval).
|
||||
* @method CarbonImmutable subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subHour() Sub one hour to the instance (using date interval).
|
||||
* @method CarbonImmutable addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMinute() Add one minute to the instance (using date interval).
|
||||
* @method CarbonImmutable subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMinute() Sub one minute to the instance (using date interval).
|
||||
* @method CarbonImmutable addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addSecond() Add one second to the instance (using date interval).
|
||||
* @method CarbonImmutable subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subSecond() Sub one second to the instance (using date interval).
|
||||
* @method CarbonImmutable addMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMilli() Add one millisecond to the instance (using date interval).
|
||||
* @method CarbonImmutable subMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMilli() Sub one millisecond to the instance (using date interval).
|
||||
* @method CarbonImmutable addMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMillisecond() Add one millisecond to the instance (using date interval).
|
||||
* @method CarbonImmutable subMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMillisecond() Sub one millisecond to the instance (using date interval).
|
||||
* @method CarbonImmutable addMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMicro() Add one microsecond to the instance (using date interval).
|
||||
* @method CarbonImmutable subMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMicro() Sub one microsecond to the instance (using date interval).
|
||||
* @method CarbonImmutable addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMicrosecond() Add one microsecond to the instance (using date interval).
|
||||
* @method CarbonImmutable subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMicrosecond() Sub one microsecond to the instance (using date interval).
|
||||
* @method CarbonImmutable addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMillennium() Add one millennium to the instance (using date interval).
|
||||
* @method CarbonImmutable subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMillennium() Sub one millennium to the instance (using date interval).
|
||||
* @method CarbonImmutable addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addCentury() Add one century to the instance (using date interval).
|
||||
* @method CarbonImmutable subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subCentury() Sub one century to the instance (using date interval).
|
||||
* @method CarbonImmutable addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addDecade() Add one decade to the instance (using date interval).
|
||||
* @method CarbonImmutable subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subDecade() Sub one decade to the instance (using date interval).
|
||||
* @method CarbonImmutable addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addQuarter() Add one quarter to the instance (using date interval).
|
||||
* @method CarbonImmutable subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subQuarter() Sub one quarter to the instance (using date interval).
|
||||
* @method CarbonImmutable addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addWeek() Add one week to the instance (using date interval).
|
||||
* @method CarbonImmutable subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subWeek() Sub one week to the instance (using date interval).
|
||||
* @method CarbonImmutable addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addWeekday() Add one weekday to the instance (using date interval).
|
||||
* @method CarbonImmutable subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subWeekday() Sub one weekday to the instance (using date interval).
|
||||
* @method CarbonImmutable addRealMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMicro() Add one microsecond to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMicro() Sub one microsecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod microsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
|
||||
* @method CarbonImmutable addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMicrosecond() Add one microsecond to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMicrosecond() Sub one microsecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod microsecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
|
||||
* @method CarbonImmutable addRealMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMilli() Add one millisecond to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMilli() Sub one millisecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod millisUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
|
||||
* @method CarbonImmutable addRealMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMillisecond() Add one millisecond to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMillisecond() Sub one millisecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod millisecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
|
||||
* @method CarbonImmutable addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealSecond() Add one second to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealSecond() Sub one second to the instance (using timestamp).
|
||||
* @method CarbonPeriod secondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given.
|
||||
* @method CarbonImmutable addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMinute() Add one minute to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMinute() Sub one minute to the instance (using timestamp).
|
||||
* @method CarbonPeriod minutesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given.
|
||||
* @method CarbonImmutable addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealHour() Add one hour to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealHour() Sub one hour to the instance (using timestamp).
|
||||
* @method CarbonPeriod hoursUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given.
|
||||
* @method CarbonImmutable addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealDay() Add one day to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealDay() Sub one day to the instance (using timestamp).
|
||||
* @method CarbonPeriod daysUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given.
|
||||
* @method CarbonImmutable addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealWeek() Add one week to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealWeek() Sub one week to the instance (using timestamp).
|
||||
* @method CarbonPeriod weeksUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given.
|
||||
* @method CarbonImmutable addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMonth() Add one month to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMonth() Sub one month to the instance (using timestamp).
|
||||
* @method CarbonPeriod monthsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given.
|
||||
* @method CarbonImmutable addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealQuarter() Add one quarter to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealQuarter() Sub one quarter to the instance (using timestamp).
|
||||
* @method CarbonPeriod quartersUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given.
|
||||
* @method CarbonImmutable addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealYear() Add one year to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealYear() Sub one year to the instance (using timestamp).
|
||||
* @method CarbonPeriod yearsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given.
|
||||
* @method CarbonImmutable addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealDecade() Add one decade to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealDecade() Sub one decade to the instance (using timestamp).
|
||||
* @method CarbonPeriod decadesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given.
|
||||
* @method CarbonImmutable addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealCentury() Add one century to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealCentury() Sub one century to the instance (using timestamp).
|
||||
* @method CarbonPeriod centuriesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given.
|
||||
* @method CarbonImmutable addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMillennium() Add one millennium to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMillennium() Sub one millennium to the instance (using timestamp).
|
||||
* @method CarbonPeriod millenniaUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given.
|
||||
* @method CarbonImmutable roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
|
||||
* @method CarbonImmutable roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
|
||||
* @method CarbonImmutable floorYear(float $precision = 1) Truncate the current instance year with given precision.
|
||||
* @method CarbonImmutable floorYears(float $precision = 1) Truncate the current instance year with given precision.
|
||||
* @method CarbonImmutable ceilYear(float $precision = 1) Ceil the current instance year with given precision.
|
||||
* @method CarbonImmutable ceilYears(float $precision = 1) Ceil the current instance year with given precision.
|
||||
* @method CarbonImmutable roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
|
||||
* @method CarbonImmutable roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
|
||||
* @method CarbonImmutable floorMonth(float $precision = 1) Truncate the current instance month with given precision.
|
||||
* @method CarbonImmutable floorMonths(float $precision = 1) Truncate the current instance month with given precision.
|
||||
* @method CarbonImmutable ceilMonth(float $precision = 1) Ceil the current instance month with given precision.
|
||||
* @method CarbonImmutable ceilMonths(float $precision = 1) Ceil the current instance month with given precision.
|
||||
* @method CarbonImmutable roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
|
||||
* @method CarbonImmutable roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
|
||||
* @method CarbonImmutable floorDay(float $precision = 1) Truncate the current instance day with given precision.
|
||||
* @method CarbonImmutable floorDays(float $precision = 1) Truncate the current instance day with given precision.
|
||||
* @method CarbonImmutable ceilDay(float $precision = 1) Ceil the current instance day with given precision.
|
||||
* @method CarbonImmutable ceilDays(float $precision = 1) Ceil the current instance day with given precision.
|
||||
* @method CarbonImmutable roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
|
||||
* @method CarbonImmutable roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
|
||||
* @method CarbonImmutable floorHour(float $precision = 1) Truncate the current instance hour with given precision.
|
||||
* @method CarbonImmutable floorHours(float $precision = 1) Truncate the current instance hour with given precision.
|
||||
* @method CarbonImmutable ceilHour(float $precision = 1) Ceil the current instance hour with given precision.
|
||||
* @method CarbonImmutable ceilHours(float $precision = 1) Ceil the current instance hour with given precision.
|
||||
* @method CarbonImmutable roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
|
||||
* @method CarbonImmutable roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
|
||||
* @method CarbonImmutable floorMinute(float $precision = 1) Truncate the current instance minute with given precision.
|
||||
* @method CarbonImmutable floorMinutes(float $precision = 1) Truncate the current instance minute with given precision.
|
||||
* @method CarbonImmutable ceilMinute(float $precision = 1) Ceil the current instance minute with given precision.
|
||||
* @method CarbonImmutable ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision.
|
||||
* @method CarbonImmutable roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
|
||||
* @method CarbonImmutable roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
|
||||
* @method CarbonImmutable floorSecond(float $precision = 1) Truncate the current instance second with given precision.
|
||||
* @method CarbonImmutable floorSeconds(float $precision = 1) Truncate the current instance second with given precision.
|
||||
* @method CarbonImmutable ceilSecond(float $precision = 1) Ceil the current instance second with given precision.
|
||||
* @method CarbonImmutable ceilSeconds(float $precision = 1) Ceil the current instance second with given precision.
|
||||
* @method CarbonImmutable roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
|
||||
* @method CarbonImmutable roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
|
||||
* @method CarbonImmutable floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision.
|
||||
* @method CarbonImmutable floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision.
|
||||
* @method CarbonImmutable ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision.
|
||||
* @method CarbonImmutable ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision.
|
||||
* @method CarbonImmutable roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
|
||||
* @method CarbonImmutable roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
|
||||
* @method CarbonImmutable floorCentury(float $precision = 1) Truncate the current instance century with given precision.
|
||||
* @method CarbonImmutable floorCenturies(float $precision = 1) Truncate the current instance century with given precision.
|
||||
* @method CarbonImmutable ceilCentury(float $precision = 1) Ceil the current instance century with given precision.
|
||||
* @method CarbonImmutable ceilCenturies(float $precision = 1) Ceil the current instance century with given precision.
|
||||
* @method CarbonImmutable roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
|
||||
* @method CarbonImmutable roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
|
||||
* @method CarbonImmutable floorDecade(float $precision = 1) Truncate the current instance decade with given precision.
|
||||
* @method CarbonImmutable floorDecades(float $precision = 1) Truncate the current instance decade with given precision.
|
||||
* @method CarbonImmutable ceilDecade(float $precision = 1) Ceil the current instance decade with given precision.
|
||||
* @method CarbonImmutable ceilDecades(float $precision = 1) Ceil the current instance decade with given precision.
|
||||
* @method CarbonImmutable roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
|
||||
* @method CarbonImmutable roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
|
||||
* @method CarbonImmutable floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision.
|
||||
* @method CarbonImmutable floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision.
|
||||
* @method CarbonImmutable ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision.
|
||||
* @method CarbonImmutable ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision.
|
||||
* @method CarbonImmutable roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
|
||||
* @method CarbonImmutable roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
|
||||
* @method CarbonImmutable floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision.
|
||||
* @method CarbonImmutable floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision.
|
||||
* @method CarbonImmutable ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision.
|
||||
* @method CarbonImmutable ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision.
|
||||
* @method CarbonImmutable roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
|
||||
* @method CarbonImmutable roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
|
||||
* @method CarbonImmutable floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision.
|
||||
* @method CarbonImmutable floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision.
|
||||
* @method CarbonImmutable ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision.
|
||||
* @method CarbonImmutable ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision.
|
||||
* @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method static CarbonImmutable|false createFromFormat(string $format, string $time, string|DateTimeZone $timezone = null) Parse a string into a new CarbonImmutable object according to the specified format.
|
||||
* @method static CarbonImmutable __set_state(array $array) https://php.net/manual/en/datetime.set-state.php
|
||||
* @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.)
|
||||
* @method bool isLocal() Check if the current instance has non-UTC timezone.
|
||||
* @method bool isValid() Check if the current instance is a valid date.
|
||||
* @method bool isDST() Check if the current instance is in a daylight saving time.
|
||||
* @method bool isSunday() Checks if the instance day is sunday.
|
||||
* @method bool isMonday() Checks if the instance day is monday.
|
||||
* @method bool isTuesday() Checks if the instance day is tuesday.
|
||||
* @method bool isWednesday() Checks if the instance day is wednesday.
|
||||
* @method bool isThursday() Checks if the instance day is thursday.
|
||||
* @method bool isFriday() Checks if the instance day is friday.
|
||||
* @method bool isSaturday() Checks if the instance day is saturday.
|
||||
* @method bool isSameYear(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentYear() Checks if the instance is in the same year as the current moment.
|
||||
* @method bool isNextYear() Checks if the instance is in the same year as the current moment next year.
|
||||
* @method bool isLastYear() Checks if the instance is in the same year as the current moment last year.
|
||||
* @method bool isSameWeek(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment.
|
||||
* @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week.
|
||||
* @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week.
|
||||
* @method bool isSameDay(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentDay() Checks if the instance is in the same day as the current moment.
|
||||
* @method bool isNextDay() Checks if the instance is in the same day as the current moment next day.
|
||||
* @method bool isLastDay() Checks if the instance is in the same day as the current moment last day.
|
||||
* @method bool isSameHour(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment.
|
||||
* @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour.
|
||||
* @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour.
|
||||
* @method bool isSameMinute(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment.
|
||||
* @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute.
|
||||
* @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute.
|
||||
* @method bool isSameSecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment.
|
||||
* @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second.
|
||||
* @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second.
|
||||
* @method bool isSameMicro(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment.
|
||||
* @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond.
|
||||
* @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond.
|
||||
* @method bool isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment.
|
||||
* @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond.
|
||||
* @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond.
|
||||
* @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment.
|
||||
* @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month.
|
||||
* @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month.
|
||||
* @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment.
|
||||
* @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter.
|
||||
* @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter.
|
||||
* @method bool isSameDecade(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment.
|
||||
* @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade.
|
||||
* @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade.
|
||||
* @method bool isSameCentury(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment.
|
||||
* @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century.
|
||||
* @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century.
|
||||
* @method bool isSameMillennium(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).
|
||||
* @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment.
|
||||
* @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium.
|
||||
* @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium.
|
||||
* @method CarbonImmutable years(int $value) Set current instance year to the given value.
|
||||
* @method CarbonImmutable year(int $value) Set current instance year to the given value.
|
||||
* @method CarbonImmutable setYears(int $value) Set current instance year to the given value.
|
||||
* @method CarbonImmutable setYear(int $value) Set current instance year to the given value.
|
||||
* @method CarbonImmutable months(int $value) Set current instance month to the given value.
|
||||
* @method CarbonImmutable month(int $value) Set current instance month to the given value.
|
||||
* @method CarbonImmutable setMonths(int $value) Set current instance month to the given value.
|
||||
* @method CarbonImmutable setMonth(int $value) Set current instance month to the given value.
|
||||
* @method CarbonImmutable days(int $value) Set current instance day to the given value.
|
||||
* @method CarbonImmutable day(int $value) Set current instance day to the given value.
|
||||
* @method CarbonImmutable setDays(int $value) Set current instance day to the given value.
|
||||
* @method CarbonImmutable setDay(int $value) Set current instance day to the given value.
|
||||
* @method CarbonImmutable hours(int $value) Set current instance hour to the given value.
|
||||
* @method CarbonImmutable hour(int $value) Set current instance hour to the given value.
|
||||
* @method CarbonImmutable setHours(int $value) Set current instance hour to the given value.
|
||||
* @method CarbonImmutable setHour(int $value) Set current instance hour to the given value.
|
||||
* @method CarbonImmutable minutes(int $value) Set current instance minute to the given value.
|
||||
* @method CarbonImmutable minute(int $value) Set current instance minute to the given value.
|
||||
* @method CarbonImmutable setMinutes(int $value) Set current instance minute to the given value.
|
||||
* @method CarbonImmutable setMinute(int $value) Set current instance minute to the given value.
|
||||
* @method CarbonImmutable seconds(int $value) Set current instance second to the given value.
|
||||
* @method CarbonImmutable second(int $value) Set current instance second to the given value.
|
||||
* @method CarbonImmutable setSeconds(int $value) Set current instance second to the given value.
|
||||
* @method CarbonImmutable setSecond(int $value) Set current instance second to the given value.
|
||||
* @method CarbonImmutable millis(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable milli(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable setMillis(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable setMilli(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable milliseconds(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable millisecond(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable setMilliseconds(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable setMillisecond(int $value) Set current instance millisecond to the given value.
|
||||
* @method CarbonImmutable micros(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable micro(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable setMicros(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable setMicro(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable microseconds(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable microsecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable setMicroseconds(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable setMicrosecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addYear() Add one year to the instance (using date interval).
|
||||
* @method CarbonImmutable subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subYear() Sub one year to the instance (using date interval).
|
||||
* @method CarbonImmutable addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMonth() Add one month to the instance (using date interval).
|
||||
* @method CarbonImmutable subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMonth() Sub one month to the instance (using date interval).
|
||||
* @method CarbonImmutable addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addDay() Add one day to the instance (using date interval).
|
||||
* @method CarbonImmutable subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subDay() Sub one day to the instance (using date interval).
|
||||
* @method CarbonImmutable addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addHour() Add one hour to the instance (using date interval).
|
||||
* @method CarbonImmutable subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subHour() Sub one hour to the instance (using date interval).
|
||||
* @method CarbonImmutable addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMinute() Add one minute to the instance (using date interval).
|
||||
* @method CarbonImmutable subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMinute() Sub one minute to the instance (using date interval).
|
||||
* @method CarbonImmutable addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addSecond() Add one second to the instance (using date interval).
|
||||
* @method CarbonImmutable subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subSecond() Sub one second to the instance (using date interval).
|
||||
* @method CarbonImmutable addMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMilli() Add one millisecond to the instance (using date interval).
|
||||
* @method CarbonImmutable subMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMilli() Sub one millisecond to the instance (using date interval).
|
||||
* @method CarbonImmutable addMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMillisecond() Add one millisecond to the instance (using date interval).
|
||||
* @method CarbonImmutable subMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMillisecond() Sub one millisecond to the instance (using date interval).
|
||||
* @method CarbonImmutable addMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMicro() Add one microsecond to the instance (using date interval).
|
||||
* @method CarbonImmutable subMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMicro() Sub one microsecond to the instance (using date interval).
|
||||
* @method CarbonImmutable addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMicrosecond() Add one microsecond to the instance (using date interval).
|
||||
* @method CarbonImmutable subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMicrosecond() Sub one microsecond to the instance (using date interval).
|
||||
* @method CarbonImmutable addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addMillennium() Add one millennium to the instance (using date interval).
|
||||
* @method CarbonImmutable subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subMillennium() Sub one millennium to the instance (using date interval).
|
||||
* @method CarbonImmutable addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addCentury() Add one century to the instance (using date interval).
|
||||
* @method CarbonImmutable subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subCentury() Sub one century to the instance (using date interval).
|
||||
* @method CarbonImmutable addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addDecade() Add one decade to the instance (using date interval).
|
||||
* @method CarbonImmutable subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subDecade() Sub one decade to the instance (using date interval).
|
||||
* @method CarbonImmutable addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addQuarter() Add one quarter to the instance (using date interval).
|
||||
* @method CarbonImmutable subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subQuarter() Sub one quarter to the instance (using date interval).
|
||||
* @method CarbonImmutable addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
|
||||
* @method CarbonImmutable addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
|
||||
* @method CarbonImmutable addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addWeek() Add one week to the instance (using date interval).
|
||||
* @method CarbonImmutable subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subWeek() Sub one week to the instance (using date interval).
|
||||
* @method CarbonImmutable addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable addWeekday() Add one weekday to the instance (using date interval).
|
||||
* @method CarbonImmutable subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonImmutable subWeekday() Sub one weekday to the instance (using date interval).
|
||||
* @method CarbonImmutable addRealMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMicro() Add one microsecond to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMicro() Sub one microsecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod microsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
|
||||
* @method CarbonImmutable addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMicrosecond() Add one microsecond to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMicrosecond() Sub one microsecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod microsecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
|
||||
* @method CarbonImmutable addRealMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMilli() Add one millisecond to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMilli() Sub one millisecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod millisUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
|
||||
* @method CarbonImmutable addRealMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMillisecond() Add one millisecond to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMillisecond() Sub one millisecond to the instance (using timestamp).
|
||||
* @method CarbonPeriod millisecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
|
||||
* @method CarbonImmutable addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealSecond() Add one second to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealSecond() Sub one second to the instance (using timestamp).
|
||||
* @method CarbonPeriod secondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given.
|
||||
* @method CarbonImmutable addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMinute() Add one minute to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMinute() Sub one minute to the instance (using timestamp).
|
||||
* @method CarbonPeriod minutesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given.
|
||||
* @method CarbonImmutable addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealHour() Add one hour to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealHour() Sub one hour to the instance (using timestamp).
|
||||
* @method CarbonPeriod hoursUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given.
|
||||
* @method CarbonImmutable addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealDay() Add one day to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealDay() Sub one day to the instance (using timestamp).
|
||||
* @method CarbonPeriod daysUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given.
|
||||
* @method CarbonImmutable addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealWeek() Add one week to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealWeek() Sub one week to the instance (using timestamp).
|
||||
* @method CarbonPeriod weeksUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given.
|
||||
* @method CarbonImmutable addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMonth() Add one month to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMonth() Sub one month to the instance (using timestamp).
|
||||
* @method CarbonPeriod monthsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given.
|
||||
* @method CarbonImmutable addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealQuarter() Add one quarter to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealQuarter() Sub one quarter to the instance (using timestamp).
|
||||
* @method CarbonPeriod quartersUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given.
|
||||
* @method CarbonImmutable addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealYear() Add one year to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealYear() Sub one year to the instance (using timestamp).
|
||||
* @method CarbonPeriod yearsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given.
|
||||
* @method CarbonImmutable addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealDecade() Add one decade to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealDecade() Sub one decade to the instance (using timestamp).
|
||||
* @method CarbonPeriod decadesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given.
|
||||
* @method CarbonImmutable addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealCentury() Add one century to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealCentury() Sub one century to the instance (using timestamp).
|
||||
* @method CarbonPeriod centuriesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given.
|
||||
* @method CarbonImmutable addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable addRealMillennium() Add one millennium to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp).
|
||||
* @method CarbonImmutable subRealMillennium() Sub one millennium to the instance (using timestamp).
|
||||
* @method CarbonPeriod millenniaUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given.
|
||||
* @method CarbonImmutable roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
|
||||
* @method CarbonImmutable roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
|
||||
* @method CarbonImmutable floorYear(float $precision = 1) Truncate the current instance year with given precision.
|
||||
* @method CarbonImmutable floorYears(float $precision = 1) Truncate the current instance year with given precision.
|
||||
* @method CarbonImmutable ceilYear(float $precision = 1) Ceil the current instance year with given precision.
|
||||
* @method CarbonImmutable ceilYears(float $precision = 1) Ceil the current instance year with given precision.
|
||||
* @method CarbonImmutable roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
|
||||
* @method CarbonImmutable roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function.
|
||||
* @method CarbonImmutable floorMonth(float $precision = 1) Truncate the current instance month with given precision.
|
||||
* @method CarbonImmutable floorMonths(float $precision = 1) Truncate the current instance month with given precision.
|
||||
* @method CarbonImmutable ceilMonth(float $precision = 1) Ceil the current instance month with given precision.
|
||||
* @method CarbonImmutable ceilMonths(float $precision = 1) Ceil the current instance month with given precision.
|
||||
* @method CarbonImmutable roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
|
||||
* @method CarbonImmutable roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function.
|
||||
* @method CarbonImmutable floorDay(float $precision = 1) Truncate the current instance day with given precision.
|
||||
* @method CarbonImmutable floorDays(float $precision = 1) Truncate the current instance day with given precision.
|
||||
* @method CarbonImmutable ceilDay(float $precision = 1) Ceil the current instance day with given precision.
|
||||
* @method CarbonImmutable ceilDays(float $precision = 1) Ceil the current instance day with given precision.
|
||||
* @method CarbonImmutable roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
|
||||
* @method CarbonImmutable roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function.
|
||||
* @method CarbonImmutable floorHour(float $precision = 1) Truncate the current instance hour with given precision.
|
||||
* @method CarbonImmutable floorHours(float $precision = 1) Truncate the current instance hour with given precision.
|
||||
* @method CarbonImmutable ceilHour(float $precision = 1) Ceil the current instance hour with given precision.
|
||||
* @method CarbonImmutable ceilHours(float $precision = 1) Ceil the current instance hour with given precision.
|
||||
* @method CarbonImmutable roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
|
||||
* @method CarbonImmutable roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function.
|
||||
* @method CarbonImmutable floorMinute(float $precision = 1) Truncate the current instance minute with given precision.
|
||||
* @method CarbonImmutable floorMinutes(float $precision = 1) Truncate the current instance minute with given precision.
|
||||
* @method CarbonImmutable ceilMinute(float $precision = 1) Ceil the current instance minute with given precision.
|
||||
* @method CarbonImmutable ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision.
|
||||
* @method CarbonImmutable roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
|
||||
* @method CarbonImmutable roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function.
|
||||
* @method CarbonImmutable floorSecond(float $precision = 1) Truncate the current instance second with given precision.
|
||||
* @method CarbonImmutable floorSeconds(float $precision = 1) Truncate the current instance second with given precision.
|
||||
* @method CarbonImmutable ceilSecond(float $precision = 1) Ceil the current instance second with given precision.
|
||||
* @method CarbonImmutable ceilSeconds(float $precision = 1) Ceil the current instance second with given precision.
|
||||
* @method CarbonImmutable roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
|
||||
* @method CarbonImmutable roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function.
|
||||
* @method CarbonImmutable floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision.
|
||||
* @method CarbonImmutable floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision.
|
||||
* @method CarbonImmutable ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision.
|
||||
* @method CarbonImmutable ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision.
|
||||
* @method CarbonImmutable roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
|
||||
* @method CarbonImmutable roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function.
|
||||
* @method CarbonImmutable floorCentury(float $precision = 1) Truncate the current instance century with given precision.
|
||||
* @method CarbonImmutable floorCenturies(float $precision = 1) Truncate the current instance century with given precision.
|
||||
* @method CarbonImmutable ceilCentury(float $precision = 1) Ceil the current instance century with given precision.
|
||||
* @method CarbonImmutable ceilCenturies(float $precision = 1) Ceil the current instance century with given precision.
|
||||
* @method CarbonImmutable roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
|
||||
* @method CarbonImmutable roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function.
|
||||
* @method CarbonImmutable floorDecade(float $precision = 1) Truncate the current instance decade with given precision.
|
||||
* @method CarbonImmutable floorDecades(float $precision = 1) Truncate the current instance decade with given precision.
|
||||
* @method CarbonImmutable ceilDecade(float $precision = 1) Ceil the current instance decade with given precision.
|
||||
* @method CarbonImmutable ceilDecades(float $precision = 1) Ceil the current instance decade with given precision.
|
||||
* @method CarbonImmutable roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
|
||||
* @method CarbonImmutable roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function.
|
||||
* @method CarbonImmutable floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision.
|
||||
* @method CarbonImmutable floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision.
|
||||
* @method CarbonImmutable ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision.
|
||||
* @method CarbonImmutable ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision.
|
||||
* @method CarbonImmutable roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
|
||||
* @method CarbonImmutable roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function.
|
||||
* @method CarbonImmutable floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision.
|
||||
* @method CarbonImmutable floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision.
|
||||
* @method CarbonImmutable ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision.
|
||||
* @method CarbonImmutable ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision.
|
||||
* @method CarbonImmutable roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
|
||||
* @method CarbonImmutable roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function.
|
||||
* @method CarbonImmutable floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision.
|
||||
* @method CarbonImmutable floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision.
|
||||
* @method CarbonImmutable ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision.
|
||||
* @method CarbonImmutable ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision.
|
||||
* @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
|
||||
* @method static static|false createFromFormat(string $format, string $time, DateTimeZone|string|false|null $timezone = null) Parse a string into a new CarbonImmutable object according to the specified format.
|
||||
* @method static static __set_state(array $array) https://php.net/manual/en/datetime.set-state.php
|
||||
*
|
||||
* </autodoc>
|
||||
*/
|
||||
|
||||
+88
-24
@@ -727,6 +727,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
/**
|
||||
* Returns the list of properties to dump on serialize() called on.
|
||||
*
|
||||
* Only used by PHP < 7.4.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep();
|
||||
@@ -736,7 +738,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now(); // Carbon instances can be casted to string
|
||||
* echo Carbon::now(); // Carbon instances can be cast to string
|
||||
* ```
|
||||
*
|
||||
* @return string
|
||||
@@ -988,7 +990,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* @param string $modifier
|
||||
*
|
||||
* @return static
|
||||
* @return static|false
|
||||
*/
|
||||
public function change($modifier);
|
||||
|
||||
@@ -1039,13 +1041,13 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
* If $hour is not null then the default values for $minute and $second
|
||||
* will be 0.
|
||||
*
|
||||
* @param int|null $year
|
||||
* @param int|null $month
|
||||
* @param int|null $day
|
||||
* @param int|null $hour
|
||||
* @param int|null $minute
|
||||
* @param int|null $second
|
||||
* @param DateTimeZone|string|null $tz
|
||||
* @param DateTimeInterface|int|null $year
|
||||
* @param int|null $month
|
||||
* @param int|null $day
|
||||
* @param int|null $hour
|
||||
* @param int|null $minute
|
||||
* @param int|null $second
|
||||
* @param DateTimeZone|string|null $tz
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
@@ -1277,7 +1279,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* @return CarbonInterval
|
||||
*/
|
||||
public function diffAsCarbonInterval($date = null, $absolute = true);
|
||||
public function diffAsCarbonInterval($date = null, $absolute = true, array $skip = []);
|
||||
|
||||
/**
|
||||
* Get the difference by the given interval using a filter closure.
|
||||
@@ -2117,6 +2119,18 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*/
|
||||
public static function getDays();
|
||||
|
||||
/**
|
||||
* Return the number of days since the start of the week (using the current locale or the first parameter
|
||||
* if explicitly given).
|
||||
*
|
||||
* @param int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week,
|
||||
* if not provided, start of week is inferred from the locale
|
||||
* (Sunday for en_US, Monday for de_DE, etc.)
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getDaysFromStartOfWeek(?int $weekStartsAt = null): int;
|
||||
|
||||
/**
|
||||
* Get the fallback locale.
|
||||
*
|
||||
@@ -2739,12 +2753,35 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
public function isLeapYear();
|
||||
|
||||
/**
|
||||
* Determines if the instance is a long year
|
||||
* Determines if the instance is a long year (using ISO 8601 year).
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* Carbon::parse('2015-01-01')->isLongYear(); // true
|
||||
* Carbon::parse('2016-01-01')->isLongYear(); // false
|
||||
* Carbon::parse('2015-01-01')->isLongIsoYear(); // true
|
||||
* Carbon::parse('2016-01-01')->isLongIsoYear(); // true
|
||||
* Carbon::parse('2016-01-03')->isLongIsoYear(); // false
|
||||
* Carbon::parse('2019-12-29')->isLongIsoYear(); // false
|
||||
* Carbon::parse('2019-12-30')->isLongIsoYear(); // true
|
||||
* ```
|
||||
*
|
||||
* @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isLongIsoYear();
|
||||
|
||||
/**
|
||||
* Determines if the instance is a long year (using calendar year).
|
||||
*
|
||||
* ⚠️ This method completely ignores month and day to use the numeric year number,
|
||||
* it's not correct if the exact date matters. For instance as `2019-12-30` is already
|
||||
* in the first week of the 2020 year, if you want to know from this date if ISO week
|
||||
* year 2020 is a long year, use `isLongIsoYear` instead.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* Carbon::create(2015)->isLongYear(); // true
|
||||
* Carbon::create(2016)->isLongYear(); // false
|
||||
* ```
|
||||
*
|
||||
* @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates
|
||||
@@ -3383,7 +3420,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* @param string|int|null $modifier
|
||||
*
|
||||
* @return static
|
||||
* @return static|false
|
||||
*/
|
||||
public function next($modifier = null);
|
||||
|
||||
@@ -3529,7 +3566,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* @param string|int|null $modifier
|
||||
*
|
||||
* @return static
|
||||
* @return static|false
|
||||
*/
|
||||
public function previous($modifier = null);
|
||||
|
||||
@@ -3774,6 +3811,19 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*/
|
||||
public function setDateTimeFrom($date = null);
|
||||
|
||||
/**
|
||||
* Set the day (keeping the current time) to the start of the week + the number of days passed as the first
|
||||
* parameter. First day of week is driven by the locale unless explicitly set with the second parameter.
|
||||
*
|
||||
* @param int $numberOfDays number of days to add after the start of the current week
|
||||
* @param int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week,
|
||||
* if not provided, start of week is inferred from the locale
|
||||
* (Sunday for en_US, Monday for de_DE, etc.)
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function setDaysFromStartOfWeek(int $numberOfDays, ?int $weekStartsAt = null);
|
||||
|
||||
/**
|
||||
* Set the fallback locale.
|
||||
*
|
||||
@@ -3861,7 +3911,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* /!\ Use this method for unit tests only.
|
||||
*
|
||||
* @param Closure|static|string|false|null $testNow real or mock Carbon instance
|
||||
* @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance
|
||||
*/
|
||||
public static function setTestNow($testNow = null);
|
||||
|
||||
@@ -3882,7 +3932,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* /!\ Use this method for unit tests only.
|
||||
*
|
||||
* @param Closure|static|string|false|null $testNow real or mock Carbon instance
|
||||
* @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance
|
||||
*/
|
||||
public static function setTestNowAndTimezone($testNow = null, $tz = null);
|
||||
|
||||
@@ -3943,11 +3993,11 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
|
||||
/**
|
||||
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
|
||||
* You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and
|
||||
* use other method or custom format passed to format() method if you need to dump an other string
|
||||
* You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and
|
||||
* use other method or custom format passed to format() method if you need to dump another string
|
||||
* format.
|
||||
*
|
||||
* Set the default format used when type juggling a Carbon instance to a string
|
||||
* Set the default format used when type juggling a Carbon instance to a string.
|
||||
*
|
||||
* @param string|Closure|null $format
|
||||
*
|
||||
@@ -4538,6 +4588,18 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*/
|
||||
public function toFormattedDateString();
|
||||
|
||||
/**
|
||||
* Format the instance with the day, and a readable date
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* echo Carbon::now()->toFormattedDayDateString();
|
||||
* ```
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toFormattedDayDateString(): string;
|
||||
|
||||
/**
|
||||
* Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept:
|
||||
* 1977-04-22T01:00:00-05:00).
|
||||
@@ -5058,12 +5120,14 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* /!\ Use this method for unit tests only.
|
||||
*
|
||||
* @param Closure|static|string|false|null $testNow real or mock Carbon instance
|
||||
* @param Closure|null $callback
|
||||
* @template T
|
||||
*
|
||||
* @return mixed
|
||||
* @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance
|
||||
* @param Closure(): T $callback
|
||||
*
|
||||
* @return T
|
||||
*/
|
||||
public static function withTestNow($testNow = null, $callback = null);
|
||||
public static function withTestNow($testNow, $callback);
|
||||
|
||||
/**
|
||||
* Create a Carbon instance for yesterday.
|
||||
|
||||
+250
-19
@@ -15,6 +15,7 @@ use Carbon\Exceptions\BadFluentConstructorException;
|
||||
use Carbon\Exceptions\BadFluentSetterException;
|
||||
use Carbon\Exceptions\InvalidCastException;
|
||||
use Carbon\Exceptions\InvalidIntervalException;
|
||||
use Carbon\Exceptions\OutOfRangeException;
|
||||
use Carbon\Exceptions\ParseErrorException;
|
||||
use Carbon\Exceptions\UnitNotConfiguredException;
|
||||
use Carbon\Exceptions\UnknownGetterException;
|
||||
@@ -28,11 +29,14 @@ use Carbon\Traits\Options;
|
||||
use Carbon\Traits\ToStringFormat;
|
||||
use Closure;
|
||||
use DateInterval;
|
||||
use DateMalformedIntervalStringException;
|
||||
use DateTimeInterface;
|
||||
use DateTimeZone;
|
||||
use Exception;
|
||||
use InvalidArgumentException;
|
||||
use ReflectionException;
|
||||
use ReturnTypeWillChange;
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
@@ -48,7 +52,7 @@ use Throwable;
|
||||
* @property int $minutes Total minutes of the current interval.
|
||||
* @property int $seconds Total seconds of the current interval.
|
||||
* @property int $microseconds Total microseconds of the current interval.
|
||||
* @property int $milliseconds Total microseconds of the current interval.
|
||||
* @property int $milliseconds Total milliseconds of the current interval.
|
||||
* @property int $microExcludeMilli Remaining microseconds without the milliseconds.
|
||||
* @property int $dayzExcludeWeeks Total days remaining in the final week of the current instance (days % 7).
|
||||
* @property int $daysExcludeWeeks alias of dayzExcludeWeeks
|
||||
@@ -245,6 +249,11 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
*/
|
||||
private static $flipCascadeFactors;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private static $floatSettersEnabled = false;
|
||||
|
||||
/**
|
||||
* The registered macros.
|
||||
*
|
||||
@@ -298,7 +307,12 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
*/
|
||||
public static function getCascadeFactors()
|
||||
{
|
||||
return static::$cascadeFactors ?: [
|
||||
return static::$cascadeFactors ?: static::getDefaultCascadeFactors();
|
||||
}
|
||||
|
||||
protected static function getDefaultCascadeFactors(): array
|
||||
{
|
||||
return [
|
||||
'milliseconds' => [Carbon::MICROSECONDS_PER_MILLISECOND, 'microseconds'],
|
||||
'seconds' => [Carbon::MILLISECONDS_PER_SECOND, 'milliseconds'],
|
||||
'minutes' => [Carbon::SECONDS_PER_MINUTE, 'seconds'],
|
||||
@@ -341,6 +355,19 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
static::$cascadeFactors = $cascadeFactors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This option allow you to opt-in for the Carbon 3 behavior where float
|
||||
* values will no longer be cast to integer (so truncated).
|
||||
*
|
||||
* ⚠️ This settings will be applied globally, which mean your whole application
|
||||
* code including the third-party dependencies that also may use Carbon will
|
||||
* adopt the new behavior.
|
||||
*/
|
||||
public static function enableFloatSetters(bool $floatSettersEnabled = true): void
|
||||
{
|
||||
self::$floatSettersEnabled = $floatSettersEnabled;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//////////////////////////// CONSTRUCTORS /////////////////////////
|
||||
///////////////////////////////////////////////////////////////////
|
||||
@@ -349,13 +376,13 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
* Create a new CarbonInterval instance.
|
||||
*
|
||||
* @param Closure|DateInterval|string|int|null $years
|
||||
* @param int|null $months
|
||||
* @param int|null $weeks
|
||||
* @param int|null $days
|
||||
* @param int|null $hours
|
||||
* @param int|null $minutes
|
||||
* @param int|null $seconds
|
||||
* @param int|null $microseconds
|
||||
* @param int|float|null $months
|
||||
* @param int|float|null $weeks
|
||||
* @param int|float|null $days
|
||||
* @param int|float|null $hours
|
||||
* @param int|float|null $minutes
|
||||
* @param int|float|null $seconds
|
||||
* @param int|float|null $microseconds
|
||||
*
|
||||
* @throws Exception when the interval_spec (passed as $years) cannot be parsed as an interval.
|
||||
*/
|
||||
@@ -375,8 +402,9 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
}
|
||||
|
||||
$spec = $years;
|
||||
$isStringSpec = (\is_string($spec) && !preg_match('/^[\d.]/', $spec));
|
||||
|
||||
if (!\is_string($spec) || (float) $years || preg_match('/^[\d.]/', $years)) {
|
||||
if (!$isStringSpec || (float) $years) {
|
||||
$spec = static::PERIOD_PREFIX;
|
||||
|
||||
$spec .= $years > 0 ? $years.static::PERIOD_YEARS : '';
|
||||
@@ -401,7 +429,74 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
}
|
||||
}
|
||||
|
||||
parent::__construct($spec);
|
||||
try {
|
||||
parent::__construct($spec);
|
||||
} catch (Throwable $exception) {
|
||||
try {
|
||||
parent::__construct('PT0S');
|
||||
|
||||
if ($isStringSpec) {
|
||||
if (!preg_match('/^P
|
||||
(?:(?<year>[+-]?\d*(?:\.\d+)?)Y)?
|
||||
(?:(?<month>[+-]?\d*(?:\.\d+)?)M)?
|
||||
(?:(?<week>[+-]?\d*(?:\.\d+)?)W)?
|
||||
(?:(?<day>[+-]?\d*(?:\.\d+)?)D)?
|
||||
(?:T
|
||||
(?:(?<hour>[+-]?\d*(?:\.\d+)?)H)?
|
||||
(?:(?<minute>[+-]?\d*(?:\.\d+)?)M)?
|
||||
(?:(?<second>[+-]?\d*(?:\.\d+)?)S)?
|
||||
)?
|
||||
$/x', $spec, $match)) {
|
||||
throw new InvalidArgumentException("Invalid duration: $spec");
|
||||
}
|
||||
|
||||
$years = (float) ($match['year'] ?? 0);
|
||||
$this->assertSafeForInteger('year', $years);
|
||||
$months = (float) ($match['month'] ?? 0);
|
||||
$this->assertSafeForInteger('month', $months);
|
||||
$weeks = (float) ($match['week'] ?? 0);
|
||||
$this->assertSafeForInteger('week', $weeks);
|
||||
$days = (float) ($match['day'] ?? 0);
|
||||
$this->assertSafeForInteger('day', $days);
|
||||
$hours = (float) ($match['hour'] ?? 0);
|
||||
$this->assertSafeForInteger('hour', $hours);
|
||||
$minutes = (float) ($match['minute'] ?? 0);
|
||||
$this->assertSafeForInteger('minute', $minutes);
|
||||
$seconds = (float) ($match['second'] ?? 0);
|
||||
$this->assertSafeForInteger('second', $seconds);
|
||||
}
|
||||
|
||||
$totalDays = (($weeks * static::getDaysPerWeek()) + $days);
|
||||
$this->assertSafeForInteger('days total (including weeks)', $totalDays);
|
||||
|
||||
$this->y = (int) $years;
|
||||
$this->m = (int) $months;
|
||||
$this->d = (int) $totalDays;
|
||||
$this->h = (int) $hours;
|
||||
$this->i = (int) $minutes;
|
||||
$this->s = (int) $seconds;
|
||||
|
||||
if (
|
||||
((float) $this->y) !== $years ||
|
||||
((float) $this->m) !== $months ||
|
||||
((float) $this->d) !== $totalDays ||
|
||||
((float) $this->h) !== $hours ||
|
||||
((float) $this->i) !== $minutes ||
|
||||
((float) $this->s) !== $seconds
|
||||
) {
|
||||
$this->add(static::fromString(
|
||||
($years - $this->y).' years '.
|
||||
($months - $this->m).' months '.
|
||||
($totalDays - $this->d).' days '.
|
||||
($hours - $this->h).' hours '.
|
||||
($minutes - $this->i).' minutes '.
|
||||
($seconds - $this->s).' seconds '
|
||||
));
|
||||
}
|
||||
} catch (Throwable $secondException) {
|
||||
throw $secondException instanceof OutOfRangeException ? $secondException : $exception;
|
||||
}
|
||||
}
|
||||
|
||||
if ($microseconds !== null) {
|
||||
$this->f = $microseconds / Carbon::MICROSECONDS_PER_SECOND;
|
||||
@@ -677,6 +772,23 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluate the PHP generated by var_export() and recreate the exported CarbonInterval instance.
|
||||
*
|
||||
* @param array $dump data as exported by var_export()
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public static function __set_state($dump)
|
||||
{
|
||||
/** @noinspection PhpVoidFunctionResultUsedInspection */
|
||||
/** @var DateInterval $dateInterval */
|
||||
$dateInterval = parent::__set_state($dump);
|
||||
|
||||
return static::instance($dateInterval);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current context from inside a macro callee or a new one if static.
|
||||
*
|
||||
@@ -947,11 +1059,18 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
* set the $days field.
|
||||
*
|
||||
* @param DateInterval $interval
|
||||
* @param bool $skipCopy set to true to return the passed object
|
||||
* (without copying it) if it's already of the
|
||||
* current class
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function instance(DateInterval $interval, array $skip = [])
|
||||
public static function instance(DateInterval $interval, array $skip = [], bool $skipCopy = false)
|
||||
{
|
||||
if ($skipCopy && $interval instanceof static) {
|
||||
return $interval;
|
||||
}
|
||||
|
||||
return self::castIntervalToClass($interval, static::class, $skip);
|
||||
}
|
||||
|
||||
@@ -963,17 +1082,20 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
*
|
||||
* @param mixed|int|DateInterval|string|Closure|null $interval interval or number of the given $unit
|
||||
* @param string|null $unit if specified, $interval must be an integer
|
||||
* @param bool $skipCopy set to true to return the passed object
|
||||
* (without copying it) if it's already of the
|
||||
* current class
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function make($interval, $unit = null)
|
||||
public static function make($interval, $unit = null, bool $skipCopy = false)
|
||||
{
|
||||
if ($unit) {
|
||||
$interval = "$interval ".Carbon::pluralUnit($unit);
|
||||
}
|
||||
|
||||
if ($interval instanceof DateInterval) {
|
||||
return static::instance($interval);
|
||||
return static::instance($interval, [], $skipCopy);
|
||||
}
|
||||
|
||||
if ($interval instanceof Closure) {
|
||||
@@ -999,8 +1121,14 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
return static::fromString($interval);
|
||||
}
|
||||
|
||||
/** @var static $interval */
|
||||
$interval = static::createFromDateString($interval);
|
||||
// @codeCoverageIgnoreStart
|
||||
try {
|
||||
/** @var static $interval */
|
||||
$interval = static::createFromDateString($interval);
|
||||
} catch (DateMalformedIntervalStringException $e) {
|
||||
return null;
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return !$interval || $interval->isEmpty() ? null : $interval;
|
||||
}
|
||||
@@ -1133,43 +1261,63 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
foreach ($properties as $key => $value) {
|
||||
switch (Carbon::singularUnit(rtrim($key, 'z'))) {
|
||||
case 'year':
|
||||
$this->checkIntegerValue($key, $value);
|
||||
$this->y = $value;
|
||||
$this->handleDecimalPart('year', $value, $this->y);
|
||||
|
||||
break;
|
||||
|
||||
case 'month':
|
||||
$this->checkIntegerValue($key, $value);
|
||||
$this->m = $value;
|
||||
$this->handleDecimalPart('month', $value, $this->m);
|
||||
|
||||
break;
|
||||
|
||||
case 'week':
|
||||
$this->d = $value * (int) static::getDaysPerWeek();
|
||||
$this->checkIntegerValue($key, $value);
|
||||
$days = $value * (int) static::getDaysPerWeek();
|
||||
$this->assertSafeForInteger('days total (including weeks)', $days);
|
||||
$this->d = $days;
|
||||
$this->handleDecimalPart('day', $days, $this->d);
|
||||
|
||||
break;
|
||||
|
||||
case 'day':
|
||||
$this->checkIntegerValue($key, $value);
|
||||
$this->d = $value;
|
||||
$this->handleDecimalPart('day', $value, $this->d);
|
||||
|
||||
break;
|
||||
|
||||
case 'daysexcludeweek':
|
||||
case 'dayzexcludeweek':
|
||||
$this->d = $this->weeks * (int) static::getDaysPerWeek() + $value;
|
||||
$this->checkIntegerValue($key, $value);
|
||||
$days = $this->weeks * (int) static::getDaysPerWeek() + $value;
|
||||
$this->assertSafeForInteger('days total (including weeks)', $days);
|
||||
$this->d = $days;
|
||||
$this->handleDecimalPart('day', $days, $this->d);
|
||||
|
||||
break;
|
||||
|
||||
case 'hour':
|
||||
$this->checkIntegerValue($key, $value);
|
||||
$this->h = $value;
|
||||
$this->handleDecimalPart('hour', $value, $this->h);
|
||||
|
||||
break;
|
||||
|
||||
case 'minute':
|
||||
$this->checkIntegerValue($key, $value);
|
||||
$this->i = $value;
|
||||
$this->handleDecimalPart('minute', $value, $this->i);
|
||||
|
||||
break;
|
||||
|
||||
case 'second':
|
||||
$this->checkIntegerValue($key, $value);
|
||||
$this->s = $value;
|
||||
$this->handleDecimalPart('second', $value, $this->s);
|
||||
|
||||
break;
|
||||
|
||||
@@ -1883,7 +2031,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
/**
|
||||
* Invert the interval.
|
||||
*
|
||||
* @param bool|int $inverted if a parameter is passed, the passed value casted as 1 or 0 is used
|
||||
* @param bool|int $inverted if a parameter is passed, the passed value cast as 1 or 0 is used
|
||||
* as the new value of the ->invert property.
|
||||
*
|
||||
* @return $this
|
||||
@@ -2720,6 +2868,15 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
*/
|
||||
public function roundUnit($unit, $precision = 1, $function = 'round')
|
||||
{
|
||||
if (static::getCascadeFactors() !== static::getDefaultCascadeFactors()) {
|
||||
$value = $function($this->total($unit) / $precision) * $precision;
|
||||
$inverted = $value < 0;
|
||||
|
||||
return $this->copyProperties(self::fromString(
|
||||
number_format(abs($value), 12, '.', '').' '.$unit
|
||||
)->invert($inverted)->cascade());
|
||||
}
|
||||
|
||||
$base = CarbonImmutable::parse('2000-01-01 00:00:00', 'UTC')
|
||||
->roundUnit($unit, $precision, $function);
|
||||
$next = $base->add($this);
|
||||
@@ -2820,4 +2977,78 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private function checkIntegerValue(string $name, $value)
|
||||
{
|
||||
if (\is_int($value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->assertSafeForInteger($name, $value);
|
||||
|
||||
if (\is_float($value) && (((float) (int) $value) === $value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!self::$floatSettersEnabled) {
|
||||
$type = \gettype($value);
|
||||
@trigger_error(
|
||||
"Since 2.70.0, it's deprecated to pass $type value for $name.\n".
|
||||
"It's truncated when stored as an integer interval unit.\n".
|
||||
"From 3.0.0, decimal part will no longer be truncated and will be cascaded to smaller units.\n".
|
||||
"- To maintain the current behavior, use explicit cast: $name((int) \$value)\n".
|
||||
"- To adopt the new behavior globally, call CarbonInterval::enableFloatSetters()\n",
|
||||
\E_USER_DEPRECATED
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Throw an exception if precision loss when storing the given value as an integer would be >= 1.0.
|
||||
*/
|
||||
private function assertSafeForInteger(string $name, $value)
|
||||
{
|
||||
if ($value && !\is_int($value) && ($value >= 0x7fffffffffffffff || $value <= -0x7fffffffffffffff)) {
|
||||
throw new OutOfRangeException($name, -0x7fffffffffffffff, 0x7fffffffffffffff, $value);
|
||||
}
|
||||
}
|
||||
|
||||
private function handleDecimalPart(string $unit, $value, $integerValue)
|
||||
{
|
||||
if (self::$floatSettersEnabled) {
|
||||
$floatValue = (float) $value;
|
||||
$base = (float) $integerValue;
|
||||
|
||||
if ($floatValue === $base) {
|
||||
return;
|
||||
}
|
||||
|
||||
$units = [
|
||||
'y' => 'year',
|
||||
'm' => 'month',
|
||||
'd' => 'day',
|
||||
'h' => 'hour',
|
||||
'i' => 'minute',
|
||||
's' => 'second',
|
||||
];
|
||||
$upper = true;
|
||||
|
||||
foreach ($units as $property => $name) {
|
||||
if ($name === $unit) {
|
||||
$upper = false;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$upper && $this->$property !== 0) {
|
||||
throw new RuntimeException(
|
||||
"You cannot set $unit to a float value as $name would be overridden, ".
|
||||
'set it first to 0 explicitly if you really want to erase its value'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->add($unit, $floatValue - $base);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+199
-143
@@ -51,43 +51,47 @@ use RuntimeException;
|
||||
* @property-read CarbonInterface $end Period end date.
|
||||
* @property-read CarbonInterval $interval Underlying date interval instance. Always present, one day by default.
|
||||
*
|
||||
* @method static CarbonPeriod start($date, $inclusive = null) Create instance specifying start date or modify the start date if called on an instance.
|
||||
* @method static CarbonPeriod since($date, $inclusive = null) Alias for start().
|
||||
* @method static CarbonPeriod sinceNow($inclusive = null) Create instance with start date set to now or set the start date to now if called on an instance.
|
||||
* @method static CarbonPeriod end($date = null, $inclusive = null) Create instance specifying end date or modify the end date if called on an instance.
|
||||
* @method static CarbonPeriod until($date = null, $inclusive = null) Alias for end().
|
||||
* @method static CarbonPeriod untilNow($inclusive = null) Create instance with end date set to now or set the end date to now if called on an instance.
|
||||
* @method static CarbonPeriod dates($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance.
|
||||
* @method static CarbonPeriod between($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance.
|
||||
* @method static CarbonPeriod recurrences($recurrences = null) Create instance with maximum number of recurrences or modify the number of recurrences if called on an instance.
|
||||
* @method static CarbonPeriod times($recurrences = null) Alias for recurrences().
|
||||
* @method static CarbonPeriod options($options = null) Create instance with options or modify the options if called on an instance.
|
||||
* @method static CarbonPeriod toggle($options, $state = null) Create instance with options toggled on or off, or toggle options if called on an instance.
|
||||
* @method static CarbonPeriod filter($callback, $name = null) Create instance with filter added to the stack or append a filter if called on an instance.
|
||||
* @method static CarbonPeriod push($callback, $name = null) Alias for filter().
|
||||
* @method static CarbonPeriod prepend($callback, $name = null) Create instance with filter prepended to the stack or prepend a filter if called on an instance.
|
||||
* @method static CarbonPeriod filters(array $filters = []) Create instance with filters stack or replace the whole filters stack if called on an instance.
|
||||
* @method static CarbonPeriod interval($interval) Create instance with given date interval or modify the interval if called on an instance.
|
||||
* @method static CarbonPeriod each($interval) Create instance with given date interval or modify the interval if called on an instance.
|
||||
* @method static CarbonPeriod every($interval) Create instance with given date interval or modify the interval if called on an instance.
|
||||
* @method static CarbonPeriod step($interval) Create instance with given date interval or modify the interval if called on an instance.
|
||||
* @method static CarbonPeriod stepBy($interval) Create instance with given date interval or modify the interval if called on an instance.
|
||||
* @method static CarbonPeriod invert() Create instance with inverted date interval or invert the interval if called on an instance.
|
||||
* @method static CarbonPeriod years($years = 1) Create instance specifying a number of years for date interval or replace the interval by the given a number of years if called on an instance.
|
||||
* @method static CarbonPeriod year($years = 1) Alias for years().
|
||||
* @method static CarbonPeriod months($months = 1) Create instance specifying a number of months for date interval or replace the interval by the given a number of months if called on an instance.
|
||||
* @method static CarbonPeriod month($months = 1) Alias for months().
|
||||
* @method static CarbonPeriod weeks($weeks = 1) Create instance specifying a number of weeks for date interval or replace the interval by the given a number of weeks if called on an instance.
|
||||
* @method static CarbonPeriod week($weeks = 1) Alias for weeks().
|
||||
* @method static CarbonPeriod days($days = 1) Create instance specifying a number of days for date interval or replace the interval by the given a number of days if called on an instance.
|
||||
* @method static CarbonPeriod dayz($days = 1) Alias for days().
|
||||
* @method static CarbonPeriod day($days = 1) Alias for days().
|
||||
* @method static CarbonPeriod hours($hours = 1) Create instance specifying a number of hours for date interval or replace the interval by the given a number of hours if called on an instance.
|
||||
* @method static CarbonPeriod hour($hours = 1) Alias for hours().
|
||||
* @method static CarbonPeriod minutes($minutes = 1) Create instance specifying a number of minutes for date interval or replace the interval by the given a number of minutes if called on an instance.
|
||||
* @method static CarbonPeriod minute($minutes = 1) Alias for minutes().
|
||||
* @method static CarbonPeriod seconds($seconds = 1) Create instance specifying a number of seconds for date interval or replace the interval by the given a number of seconds if called on an instance.
|
||||
* @method static CarbonPeriod second($seconds = 1) Alias for seconds().
|
||||
* @method static static start($date, $inclusive = null) Create instance specifying start date or modify the start date if called on an instance.
|
||||
* @method static static since($date, $inclusive = null) Alias for start().
|
||||
* @method static static sinceNow($inclusive = null) Create instance with start date set to now or set the start date to now if called on an instance.
|
||||
* @method static static end($date = null, $inclusive = null) Create instance specifying end date or modify the end date if called on an instance.
|
||||
* @method static static until($date = null, $inclusive = null) Alias for end().
|
||||
* @method static static untilNow($inclusive = null) Create instance with end date set to now or set the end date to now if called on an instance.
|
||||
* @method static static dates($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance.
|
||||
* @method static static between($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance.
|
||||
* @method static static recurrences($recurrences = null) Create instance with maximum number of recurrences or modify the number of recurrences if called on an instance.
|
||||
* @method static static times($recurrences = null) Alias for recurrences().
|
||||
* @method static static options($options = null) Create instance with options or modify the options if called on an instance.
|
||||
* @method static static toggle($options, $state = null) Create instance with options toggled on or off, or toggle options if called on an instance.
|
||||
* @method static static filter($callback, $name = null) Create instance with filter added to the stack or append a filter if called on an instance.
|
||||
* @method static static push($callback, $name = null) Alias for filter().
|
||||
* @method static static prepend($callback, $name = null) Create instance with filter prepended to the stack or prepend a filter if called on an instance.
|
||||
* @method static static filters(array $filters = []) Create instance with filters stack or replace the whole filters stack if called on an instance.
|
||||
* @method static static interval($interval) Create instance with given date interval or modify the interval if called on an instance.
|
||||
* @method static static each($interval) Create instance with given date interval or modify the interval if called on an instance.
|
||||
* @method static static every($interval) Create instance with given date interval or modify the interval if called on an instance.
|
||||
* @method static static step($interval) Create instance with given date interval or modify the interval if called on an instance.
|
||||
* @method static static stepBy($interval) Create instance with given date interval or modify the interval if called on an instance.
|
||||
* @method static static invert() Create instance with inverted date interval or invert the interval if called on an instance.
|
||||
* @method static static years($years = 1) Create instance specifying a number of years for date interval or replace the interval by the given a number of years if called on an instance.
|
||||
* @method static static year($years = 1) Alias for years().
|
||||
* @method static static months($months = 1) Create instance specifying a number of months for date interval or replace the interval by the given a number of months if called on an instance.
|
||||
* @method static static month($months = 1) Alias for months().
|
||||
* @method static static weeks($weeks = 1) Create instance specifying a number of weeks for date interval or replace the interval by the given a number of weeks if called on an instance.
|
||||
* @method static static week($weeks = 1) Alias for weeks().
|
||||
* @method static static days($days = 1) Create instance specifying a number of days for date interval or replace the interval by the given a number of days if called on an instance.
|
||||
* @method static static dayz($days = 1) Alias for days().
|
||||
* @method static static day($days = 1) Alias for days().
|
||||
* @method static static hours($hours = 1) Create instance specifying a number of hours for date interval or replace the interval by the given a number of hours if called on an instance.
|
||||
* @method static static hour($hours = 1) Alias for hours().
|
||||
* @method static static minutes($minutes = 1) Create instance specifying a number of minutes for date interval or replace the interval by the given a number of minutes if called on an instance.
|
||||
* @method static static minute($minutes = 1) Alias for minutes().
|
||||
* @method static static seconds($seconds = 1) Create instance specifying a number of seconds for date interval or replace the interval by the given a number of seconds if called on an instance.
|
||||
* @method static static second($seconds = 1) Alias for seconds().
|
||||
* @method static static milliseconds($milliseconds = 1) Create instance specifying a number of milliseconds for date interval or replace the interval by the given a number of milliseconds if called on an instance.
|
||||
* @method static static millisecond($milliseconds = 1) Alias for milliseconds().
|
||||
* @method static static microseconds($microseconds = 1) Create instance specifying a number of microseconds for date interval or replace the interval by the given a number of microseconds if called on an instance.
|
||||
* @method static static microsecond($microseconds = 1) Alias for microseconds().
|
||||
* @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
|
||||
* @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function.
|
||||
* @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision.
|
||||
@@ -234,6 +238,13 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*/
|
||||
public const END_MAX_ATTEMPTS = 10000;
|
||||
|
||||
/**
|
||||
* Default date class of iteration items.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected const DEFAULT_DATE_CLASS = Carbon::class;
|
||||
|
||||
/**
|
||||
* The registered macros.
|
||||
*
|
||||
@@ -255,6 +266,13 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*/
|
||||
protected $dateInterval;
|
||||
|
||||
/**
|
||||
* True once __construct is finished.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $constructed = false;
|
||||
|
||||
/**
|
||||
* Whether current date interval was set by default.
|
||||
*
|
||||
@@ -486,15 +504,16 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
$interval = null;
|
||||
$start = null;
|
||||
$end = null;
|
||||
$dateClass = static::DEFAULT_DATE_CLASS;
|
||||
|
||||
foreach (explode('/', $iso) as $key => $part) {
|
||||
if ($key === 0 && preg_match('/^R(\d*|INF)$/', $part, $match)) {
|
||||
$parsed = \strlen($match[1]) ? (($match[1] !== 'INF') ? (int) $match[1] : INF) : null;
|
||||
} elseif ($interval === null && $parsed = CarbonInterval::make($part)) {
|
||||
$interval = $part;
|
||||
} elseif ($start === null && $parsed = Carbon::make($part)) {
|
||||
} elseif ($start === null && $parsed = $dateClass::make($part)) {
|
||||
$start = $part;
|
||||
} elseif ($end === null && $parsed = Carbon::make(static::addMissingParts($start ?? '', $part))) {
|
||||
} elseif ($end === null && $parsed = $dateClass::make(static::addMissingParts($start ?? '', $part))) {
|
||||
$end = $part;
|
||||
} else {
|
||||
throw new InvalidPeriodParameterException("Invalid ISO 8601 specification: $iso.");
|
||||
@@ -625,6 +644,10 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*/
|
||||
public function __construct(...$arguments)
|
||||
{
|
||||
if (is_a($this->dateClass, DateTimeImmutable::class, true)) {
|
||||
$this->options = static::IMMUTABLE;
|
||||
}
|
||||
|
||||
// Parse and assign arguments one by one. First argument may be an ISO 8601 spec,
|
||||
// which will be first parsed into parts and then processed the same way.
|
||||
|
||||
@@ -652,6 +675,8 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
}
|
||||
}
|
||||
|
||||
$optionsSet = false;
|
||||
|
||||
foreach ($arguments as $argument) {
|
||||
$parsedDate = null;
|
||||
|
||||
@@ -675,15 +700,17 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
$this->setEndDate($parsedDate);
|
||||
} elseif ($this->recurrences === null && $this->endDate === null && is_numeric($argument)) {
|
||||
$this->setRecurrences($argument);
|
||||
} elseif ($this->options === null && (\is_int($argument) || $argument === null)) {
|
||||
$this->setOptions($argument);
|
||||
} elseif (!$optionsSet && (\is_int($argument) || $argument === null)) {
|
||||
$optionsSet = true;
|
||||
$this->setOptions(((int) $this->options) | ((int) $argument));
|
||||
} else {
|
||||
throw new InvalidPeriodParameterException('Invalid constructor parameters.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->startDate === null) {
|
||||
$this->setStartDate(Carbon::now());
|
||||
$dateClass = $this->dateClass;
|
||||
$this->setStartDate($dateClass::now());
|
||||
}
|
||||
|
||||
if ($this->dateInterval === null) {
|
||||
@@ -695,6 +722,8 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
if ($this->options === null) {
|
||||
$this->setOptions(0);
|
||||
}
|
||||
|
||||
$this->constructed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -707,6 +736,17 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
return clone $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the instance to be set (self if mutable to be mutated,
|
||||
* copy if immutable to generate a new instance).
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
protected function copyIfImmutable()
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the getter for a property allowing both `DatePeriod` snakeCase and camelCase names.
|
||||
*
|
||||
@@ -798,7 +838,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*
|
||||
* @param string $dateClass
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function setDateClass(string $dateClass)
|
||||
{
|
||||
@@ -806,15 +846,16 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
throw new NotACarbonClassException($dateClass);
|
||||
}
|
||||
|
||||
$this->dateClass = $dateClass;
|
||||
$self = $this->copyIfImmutable();
|
||||
$self->dateClass = $dateClass;
|
||||
|
||||
if (is_a($dateClass, Carbon::class, true)) {
|
||||
$this->toggleOptions(static::IMMUTABLE, false);
|
||||
$self->options = $self->options & ~static::IMMUTABLE;
|
||||
} elseif (is_a($dateClass, CarbonImmutable::class, true)) {
|
||||
$this->toggleOptions(static::IMMUTABLE, true);
|
||||
$self->options = $self->options | static::IMMUTABLE;
|
||||
}
|
||||
|
||||
return $this;
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -834,7 +875,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*
|
||||
* @throws InvalidIntervalException
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function setDateInterval($interval)
|
||||
{
|
||||
@@ -846,25 +887,24 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
throw new InvalidIntervalException('Empty interval is not accepted.');
|
||||
}
|
||||
|
||||
$this->dateInterval = $interval;
|
||||
$self = $this->copyIfImmutable();
|
||||
$self->dateInterval = $interval;
|
||||
|
||||
$this->isDefaultInterval = false;
|
||||
$self->isDefaultInterval = false;
|
||||
|
||||
$this->handleChangedParameters();
|
||||
$self->handleChangedParameters();
|
||||
|
||||
return $this;
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invert the period date interval.
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function invertDateInterval()
|
||||
{
|
||||
$interval = $this->dateInterval->invert();
|
||||
|
||||
return $this->setDateInterval($interval);
|
||||
return $this->setDateInterval($this->dateInterval->invert());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -873,14 +913,11 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
* @param DateTime|DateTimeInterface|string $start
|
||||
* @param DateTime|DateTimeInterface|string|null $end
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function setDates($start, $end)
|
||||
{
|
||||
$this->setStartDate($start);
|
||||
$this->setEndDate($end);
|
||||
|
||||
return $this;
|
||||
return $this->setStartDate($start)->setEndDate($end);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -890,7 +927,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function setOptions($options)
|
||||
{
|
||||
@@ -898,11 +935,12 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
throw new InvalidPeriodParameterException('Invalid options.');
|
||||
}
|
||||
|
||||
$this->options = $options ?: 0;
|
||||
$self = $this->copyIfImmutable();
|
||||
$self->options = $options ?: 0;
|
||||
|
||||
$this->handleChangedParameters();
|
||||
$self->handleChangedParameters();
|
||||
|
||||
return $this;
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -923,7 +961,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function toggleOptions($options, $state = null)
|
||||
{
|
||||
@@ -943,7 +981,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*
|
||||
* @param bool $state
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function excludeStartDate($state = true)
|
||||
{
|
||||
@@ -955,7 +993,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*
|
||||
* @param bool $state
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function excludeEndDate($state = true)
|
||||
{
|
||||
@@ -1099,17 +1137,18 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
* @param callable $callback
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function addFilter($callback, $name = null)
|
||||
{
|
||||
$tuple = $this->createFilterTuple(\func_get_args());
|
||||
$self = $this->copyIfImmutable();
|
||||
$tuple = $self->createFilterTuple(\func_get_args());
|
||||
|
||||
$this->filters[] = $tuple;
|
||||
$self->filters[] = $tuple;
|
||||
|
||||
$this->handleChangedParameters();
|
||||
$self->handleChangedParameters();
|
||||
|
||||
return $this;
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1120,17 +1159,18 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
* @param callable $callback
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function prependFilter($callback, $name = null)
|
||||
{
|
||||
$tuple = $this->createFilterTuple(\func_get_args());
|
||||
$self = $this->copyIfImmutable();
|
||||
$tuple = $self->createFilterTuple(\func_get_args());
|
||||
|
||||
array_unshift($this->filters, $tuple);
|
||||
array_unshift($self->filters, $tuple);
|
||||
|
||||
$this->handleChangedParameters();
|
||||
$self->handleChangedParameters();
|
||||
|
||||
return $this;
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1138,24 +1178,25 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*
|
||||
* @param callable|string $filter
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function removeFilter($filter)
|
||||
{
|
||||
$self = $this->copyIfImmutable();
|
||||
$key = \is_callable($filter) ? 0 : 1;
|
||||
|
||||
$this->filters = array_values(array_filter(
|
||||
$self->filters = array_values(array_filter(
|
||||
$this->filters,
|
||||
function ($tuple) use ($key, $filter) {
|
||||
return $tuple[$key] !== $filter;
|
||||
}
|
||||
));
|
||||
|
||||
$this->updateInternalState();
|
||||
$self->updateInternalState();
|
||||
|
||||
$this->handleChangedParameters();
|
||||
$self->handleChangedParameters();
|
||||
|
||||
return $this;
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1193,39 +1234,41 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*
|
||||
* @param array $filters
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function setFilters(array $filters)
|
||||
{
|
||||
$this->filters = $filters;
|
||||
$self = $this->copyIfImmutable();
|
||||
$self->filters = $filters;
|
||||
|
||||
$this->updateInternalState();
|
||||
$self->updateInternalState();
|
||||
|
||||
$this->handleChangedParameters();
|
||||
$self->handleChangedParameters();
|
||||
|
||||
return $this;
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset filters stack.
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function resetFilters()
|
||||
{
|
||||
$this->filters = [];
|
||||
$self = $this->copyIfImmutable();
|
||||
$self->filters = [];
|
||||
|
||||
if ($this->endDate !== null) {
|
||||
$this->filters[] = [static::END_DATE_FILTER, null];
|
||||
if ($self->endDate !== null) {
|
||||
$self->filters[] = [static::END_DATE_FILTER, null];
|
||||
}
|
||||
|
||||
if ($this->recurrences !== null) {
|
||||
$this->filters[] = [static::RECURRENCES_FILTER, null];
|
||||
if ($self->recurrences !== null) {
|
||||
$self->filters[] = [static::RECURRENCES_FILTER, null];
|
||||
}
|
||||
|
||||
$this->handleChangedParameters();
|
||||
$self->handleChangedParameters();
|
||||
|
||||
return $this;
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1235,7 +1278,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function setRecurrences($recurrences)
|
||||
{
|
||||
@@ -1247,15 +1290,17 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
return $this->removeFilter(static::RECURRENCES_FILTER);
|
||||
}
|
||||
|
||||
$this->recurrences = $recurrences === INF ? INF : (int) $recurrences;
|
||||
/** @var self $self */
|
||||
$self = $this->copyIfImmutable();
|
||||
$self->recurrences = $recurrences === INF ? INF : (int) $recurrences;
|
||||
|
||||
if (!$this->hasFilter(static::RECURRENCES_FILTER)) {
|
||||
return $this->addFilter(static::RECURRENCES_FILTER);
|
||||
if (!$self->hasFilter(static::RECURRENCES_FILTER)) {
|
||||
return $self->addFilter(static::RECURRENCES_FILTER);
|
||||
}
|
||||
|
||||
$this->handleChangedParameters();
|
||||
$self->handleChangedParameters();
|
||||
|
||||
return $this;
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1266,7 +1311,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*
|
||||
* @throws InvalidPeriodDateException
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function setStartDate($date, $inclusive = null)
|
||||
{
|
||||
@@ -1274,13 +1319,14 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
throw new InvalidPeriodDateException('Invalid start date.');
|
||||
}
|
||||
|
||||
$this->startDate = $date;
|
||||
$self = $this->copyIfImmutable();
|
||||
$self->startDate = $date;
|
||||
|
||||
if ($inclusive !== null) {
|
||||
$this->toggleOptions(static::EXCLUDE_START_DATE, !$inclusive);
|
||||
$self = $self->toggleOptions(static::EXCLUDE_START_DATE, !$inclusive);
|
||||
}
|
||||
|
||||
return $this;
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1291,7 +1337,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function setEndDate($date, $inclusive = null)
|
||||
{
|
||||
@@ -1303,19 +1349,20 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
return $this->removeFilter(static::END_DATE_FILTER);
|
||||
}
|
||||
|
||||
$this->endDate = $date;
|
||||
$self = $this->copyIfImmutable();
|
||||
$self->endDate = $date;
|
||||
|
||||
if ($inclusive !== null) {
|
||||
$this->toggleOptions(static::EXCLUDE_END_DATE, !$inclusive);
|
||||
$self = $self->toggleOptions(static::EXCLUDE_END_DATE, !$inclusive);
|
||||
}
|
||||
|
||||
if (!$this->hasFilter(static::END_DATE_FILTER)) {
|
||||
return $this->addFilter(static::END_DATE_FILTER);
|
||||
if (!$self->hasFilter(static::END_DATE_FILTER)) {
|
||||
return $self->addFilter(static::END_DATE_FILTER);
|
||||
}
|
||||
|
||||
$this->handleChangedParameters();
|
||||
$self->handleChangedParameters();
|
||||
|
||||
return $this;
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1778,13 +1825,19 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
case 'minute':
|
||||
case 'seconds':
|
||||
case 'second':
|
||||
case 'milliseconds':
|
||||
case 'millisecond':
|
||||
case 'microseconds':
|
||||
case 'microsecond':
|
||||
return $this->setDateInterval((
|
||||
// Override default P1D when instantiating via fluent setters.
|
||||
[$this->isDefaultInterval ? new CarbonInterval('PT0S') : $this->dateInterval, $method]
|
||||
)(...$parameters));
|
||||
}
|
||||
|
||||
if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) {
|
||||
$dateClass = $this->dateClass;
|
||||
|
||||
if ($this->localStrictModeEnabled ?? $dateClass::isStrictModeEnabled()) {
|
||||
throw new UnknownMethodException($method);
|
||||
}
|
||||
|
||||
@@ -1800,18 +1853,19 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*/
|
||||
public function setTimezone($timezone)
|
||||
{
|
||||
$this->tzName = $timezone;
|
||||
$this->timezone = $timezone;
|
||||
$self = $this->copyIfImmutable();
|
||||
$self->tzName = $timezone;
|
||||
$self->timezone = $timezone;
|
||||
|
||||
if ($this->startDate) {
|
||||
$this->setStartDate($this->startDate->setTimezone($timezone));
|
||||
if ($self->startDate) {
|
||||
$self = $self->setStartDate($self->startDate->setTimezone($timezone));
|
||||
}
|
||||
|
||||
if ($this->endDate) {
|
||||
$this->setEndDate($this->endDate->setTimezone($timezone));
|
||||
if ($self->endDate) {
|
||||
$self = $self->setEndDate($self->endDate->setTimezone($timezone));
|
||||
}
|
||||
|
||||
return $this;
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1823,18 +1877,19 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*/
|
||||
public function shiftTimezone($timezone)
|
||||
{
|
||||
$this->tzName = $timezone;
|
||||
$this->timezone = $timezone;
|
||||
$self = $this->copyIfImmutable();
|
||||
$self->tzName = $timezone;
|
||||
$self->timezone = $timezone;
|
||||
|
||||
if ($this->startDate) {
|
||||
$this->setStartDate($this->startDate->shiftTimezone($timezone));
|
||||
if ($self->startDate) {
|
||||
$self = $self->setStartDate($self->startDate->shiftTimezone($timezone));
|
||||
}
|
||||
|
||||
if ($this->endDate) {
|
||||
$this->setEndDate($this->endDate->shiftTimezone($timezone));
|
||||
if ($self->endDate) {
|
||||
$self = $self->setEndDate($self->endDate->shiftTimezone($timezone));
|
||||
}
|
||||
|
||||
return $this;
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2213,19 +2268,18 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
* @param float|int|string|\DateInterval|null $precision
|
||||
* @param string $function
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function roundUnit($unit, $precision = 1, $function = 'round')
|
||||
{
|
||||
$this->setStartDate($this->getStartDate()->roundUnit($unit, $precision, $function));
|
||||
$self = $this->copyIfImmutable();
|
||||
$self = $self->setStartDate($self->getStartDate()->roundUnit($unit, $precision, $function));
|
||||
|
||||
if ($this->endDate) {
|
||||
$this->setEndDate($this->getEndDate()->roundUnit($unit, $precision, $function));
|
||||
if ($self->endDate) {
|
||||
$self = $self->setEndDate($self->getEndDate()->roundUnit($unit, $precision, $function));
|
||||
}
|
||||
|
||||
$this->setDateInterval($this->getDateInterval()->roundUnit($unit, $precision, $function));
|
||||
|
||||
return $this;
|
||||
return $self->setDateInterval($self->getDateInterval()->roundUnit($unit, $precision, $function));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2234,7 +2288,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
* @param string $unit
|
||||
* @param float|int|string|\DateInterval|null $precision
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function floorUnit($unit, $precision = 1)
|
||||
{
|
||||
@@ -2247,7 +2301,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
* @param string $unit
|
||||
* @param float|int|string|\DateInterval|null $precision
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function ceilUnit($unit, $precision = 1)
|
||||
{
|
||||
@@ -2260,7 +2314,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
* @param float|int|string|\DateInterval|null $precision
|
||||
* @param string $function
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function round($precision = null, $function = 'round')
|
||||
{
|
||||
@@ -2275,7 +2329,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*
|
||||
* @param float|int|string|\DateInterval|null $precision
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function floor($precision = null)
|
||||
{
|
||||
@@ -2287,7 +2341,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
*
|
||||
* @param float|int|string|\DateInterval|null $precision
|
||||
*
|
||||
* @return $this
|
||||
* @return static
|
||||
*/
|
||||
public function ceil($precision = null)
|
||||
{
|
||||
@@ -2476,9 +2530,9 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
protected function handleChangedParameters()
|
||||
{
|
||||
if (($this->getOptions() & static::IMMUTABLE) && $this->dateClass === Carbon::class) {
|
||||
$this->setDateClass(CarbonImmutable::class);
|
||||
$this->dateClass = CarbonImmutable::class;
|
||||
} elseif (!($this->getOptions() & static::IMMUTABLE) && $this->dateClass === CarbonImmutable::class) {
|
||||
$this->setDateClass(Carbon::class);
|
||||
$this->dateClass = Carbon::class;
|
||||
}
|
||||
|
||||
$this->validationResult = null;
|
||||
@@ -2642,7 +2696,9 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
|
||||
!preg_match('/^R\d/', $value) &&
|
||||
preg_match('/[a-z\d]/i', $value)
|
||||
) {
|
||||
return Carbon::parse($value, $this->tzName);
|
||||
$dateClass = $this->dateClass;
|
||||
|
||||
return $dateClass::parse($value, $this->tzName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon;
|
||||
|
||||
class CarbonPeriodImmutable extends CarbonPeriod
|
||||
{
|
||||
/**
|
||||
* Default date class of iteration items.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected const DEFAULT_DATE_CLASS = CarbonImmutable::class;
|
||||
|
||||
/**
|
||||
* Date class of iteration items.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $dateClass = CarbonImmutable::class;
|
||||
|
||||
/**
|
||||
* Prepare the instance to be set (self if mutable to be mutated,
|
||||
* copy if immutable to generate a new instance).
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
protected function copyIfImmutable()
|
||||
{
|
||||
return $this->constructed ? clone $this : $this;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\Doctrine;
|
||||
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
|
||||
interface CarbonDoctrineType
|
||||
{
|
||||
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform);
|
||||
|
||||
public function convertToPHPValue($value, AbstractPlatform $platform);
|
||||
|
||||
public function convertToDatabaseValue($value, AbstractPlatform $platform);
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\Doctrine;
|
||||
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
|
||||
class CarbonImmutableType extends DateTimeImmutableType implements CarbonDoctrineType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'carbon_immutable';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function requiresSQLCommentHint(AbstractPlatform $platform)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\Doctrine;
|
||||
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
|
||||
class CarbonType extends DateTimeType implements CarbonDoctrineType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'carbon';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function requiresSQLCommentHint(AbstractPlatform $platform)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\Doctrine;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Carbon\CarbonInterface;
|
||||
use DateTimeInterface;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Types\ConversionException;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* @template T of CarbonInterface
|
||||
*/
|
||||
trait CarbonTypeConverter
|
||||
{
|
||||
/**
|
||||
* @return class-string<T>
|
||||
*/
|
||||
protected function getCarbonClassName(): string
|
||||
{
|
||||
return Carbon::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
|
||||
{
|
||||
$precision = $fieldDeclaration['precision'] ?: 10;
|
||||
|
||||
if ($fieldDeclaration['secondPrecision'] ?? false) {
|
||||
$precision = 0;
|
||||
}
|
||||
|
||||
if ($precision === 10) {
|
||||
$precision = DateTimeDefaultPrecision::get();
|
||||
}
|
||||
|
||||
$type = parent::getSQLDeclaration($fieldDeclaration, $platform);
|
||||
|
||||
if (!$precision) {
|
||||
return $type;
|
||||
}
|
||||
|
||||
if (str_contains($type, '(')) {
|
||||
return preg_replace('/\(\d+\)/', "($precision)", $type);
|
||||
}
|
||||
|
||||
[$before, $after] = explode(' ', "$type ");
|
||||
|
||||
return trim("$before($precision) $after");
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*
|
||||
* @return T|null
|
||||
*/
|
||||
public function convertToPHPValue($value, AbstractPlatform $platform)
|
||||
{
|
||||
$class = $this->getCarbonClassName();
|
||||
|
||||
if ($value === null || is_a($value, $class)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
if ($value instanceof DateTimeInterface) {
|
||||
return $class::instance($value);
|
||||
}
|
||||
|
||||
$date = null;
|
||||
$error = null;
|
||||
|
||||
try {
|
||||
$date = $class::parse($value);
|
||||
} catch (Exception $exception) {
|
||||
$error = $exception;
|
||||
}
|
||||
|
||||
if (!$date) {
|
||||
throw ConversionException::conversionFailedFormat(
|
||||
$value,
|
||||
$this->getName(),
|
||||
'Y-m-d H:i:s.u or any format supported by '.$class.'::parse()',
|
||||
$error
|
||||
);
|
||||
}
|
||||
|
||||
return $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function convertToDatabaseValue($value, AbstractPlatform $platform)
|
||||
{
|
||||
if ($value === null) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
if ($value instanceof DateTimeInterface) {
|
||||
return $value->format('Y-m-d H:i:s.u');
|
||||
}
|
||||
|
||||
throw ConversionException::conversionFailedInvalidType(
|
||||
$value,
|
||||
$this->getName(),
|
||||
['null', 'DateTime', 'Carbon']
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\Doctrine;
|
||||
|
||||
class DateTimeDefaultPrecision
|
||||
{
|
||||
private static $precision = 6;
|
||||
|
||||
/**
|
||||
* Change the default Doctrine datetime and datetime_immutable precision.
|
||||
*
|
||||
* @param int $precision
|
||||
*/
|
||||
public static function set(int $precision): void
|
||||
{
|
||||
self::$precision = $precision;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default Doctrine datetime and datetime_immutable precision.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function get(): int
|
||||
{
|
||||
return self::$precision;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Thanks to https://github.com/flaushi for his suggestion:
|
||||
* https://github.com/doctrine/dbal/issues/2873#issuecomment-534956358
|
||||
*/
|
||||
namespace Carbon\Doctrine;
|
||||
|
||||
use Carbon\CarbonImmutable;
|
||||
use Doctrine\DBAL\Types\VarDateTimeImmutableType;
|
||||
|
||||
class DateTimeImmutableType extends VarDateTimeImmutableType implements CarbonDoctrineType
|
||||
{
|
||||
/** @use CarbonTypeConverter<CarbonImmutable> */
|
||||
use CarbonTypeConverter;
|
||||
|
||||
/**
|
||||
* @return class-string<CarbonImmutable>
|
||||
*/
|
||||
protected function getCarbonClassName(): string
|
||||
{
|
||||
return CarbonImmutable::class;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Thanks to https://github.com/flaushi for his suggestion:
|
||||
* https://github.com/doctrine/dbal/issues/2873#issuecomment-534956358
|
||||
*/
|
||||
namespace Carbon\Doctrine;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Doctrine\DBAL\Types\VarDateTimeType;
|
||||
|
||||
class DateTimeType extends VarDateTimeType implements CarbonDoctrineType
|
||||
{
|
||||
/** @use CarbonTypeConverter<Carbon> */
|
||||
use CarbonTypeConverter;
|
||||
}
|
||||
+4
-4
@@ -177,10 +177,10 @@ use ReflectionMethod;
|
||||
* parameter of null.
|
||||
* /!\ Use this method for unit tests only.
|
||||
* @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
|
||||
* You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and
|
||||
* use other method or custom format passed to format() method if you need to dump an other string
|
||||
* You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and
|
||||
* use other method or custom format passed to format() method if you need to dump another string
|
||||
* format.
|
||||
* Set the default format used when type juggling a Carbon instance to a string
|
||||
* Set the default format used when type juggling a Carbon instance to a string.
|
||||
* @method void setTranslator(TranslatorInterface $translator) Set the default translator instance to use.
|
||||
* @method Carbon setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
|
||||
* You should rather use UTF-8 language packages on every machine.
|
||||
@@ -231,7 +231,7 @@ use ReflectionMethod;
|
||||
* You should rather use the ->settings() method.
|
||||
* Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants
|
||||
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
|
||||
* @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback.
|
||||
* @method mixed withTestNow($testNow, $callback) Temporarily sets a static date to be used within the callback.
|
||||
* Using setTestNow to set the date, executing the callback, then
|
||||
* clearing the test instance.
|
||||
* /!\ Use this method for unit tests only.
|
||||
|
||||
+22
-6
@@ -12,6 +12,9 @@
|
||||
namespace Carbon;
|
||||
|
||||
use Closure;
|
||||
use DateTimeImmutable;
|
||||
use DateTimeZone;
|
||||
use Psr\Clock\ClockInterface;
|
||||
|
||||
/**
|
||||
* A factory to generate CarbonImmutable instances with common settings.
|
||||
@@ -111,7 +114,6 @@ use Closure;
|
||||
* @method CarbonImmutable maxValue() Create a Carbon instance for the greatest supported date.
|
||||
* @method CarbonImmutable minValue() Create a Carbon instance for the lowest supported date.
|
||||
* @method void mixin($mixin) Mix another object into the class.
|
||||
* @method CarbonImmutable now($tz = null) Get a Carbon instance for the current date and time.
|
||||
* @method CarbonImmutable parse($time = null, $tz = null) Create a carbon instance from a string.
|
||||
* This is an alias for the constructor that allows better fluent syntax
|
||||
* as it allows you to do Carbon::parse('Monday next week')->fn() rather
|
||||
@@ -175,10 +177,10 @@ use Closure;
|
||||
* parameter of null.
|
||||
* /!\ Use this method for unit tests only.
|
||||
* @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
|
||||
* You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and
|
||||
* use other method or custom format passed to format() method if you need to dump an other string
|
||||
* You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and
|
||||
* use other method or custom format passed to format() method if you need to dump another string
|
||||
* format.
|
||||
* Set the default format used when type juggling a Carbon instance to a string
|
||||
* Set the default format used when type juggling a Carbon instance to a string.
|
||||
* @method void setTranslator(TranslatorInterface $translator) Set the default translator instance to use.
|
||||
* @method CarbonImmutable setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
|
||||
* You should rather use UTF-8 language packages on every machine.
|
||||
@@ -229,7 +231,7 @@ use Closure;
|
||||
* You should rather use the ->settings() method.
|
||||
* Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants
|
||||
* are available for quarters, years, decade, centuries, millennia (singular and plural forms).
|
||||
* @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback.
|
||||
* @method mixed withTestNow($testNow, $callback) Temporarily sets a static date to be used within the callback.
|
||||
* Using setTestNow to set the date, executing the callback, then
|
||||
* clearing the test instance.
|
||||
* /!\ Use this method for unit tests only.
|
||||
@@ -237,7 +239,21 @@ use Closure;
|
||||
*
|
||||
* </autodoc>
|
||||
*/
|
||||
class FactoryImmutable extends Factory
|
||||
class FactoryImmutable extends Factory implements ClockInterface
|
||||
{
|
||||
protected $className = CarbonImmutable::class;
|
||||
|
||||
/**
|
||||
* Get a Carbon instance for the current date and time.
|
||||
*
|
||||
* @param DateTimeZone|string|int|null $tz
|
||||
*
|
||||
* @return CarbonImmutable
|
||||
*/
|
||||
public function now($tz = null): DateTimeImmutable
|
||||
{
|
||||
$className = $this->className;
|
||||
|
||||
return new $className(null, $tz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
/*
|
||||
* Authors:
|
||||
* - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'formats' => [
|
||||
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
'first_day_of_week' => 6,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
]);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
/*
|
||||
* Authors:
|
||||
* - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'formats' => [
|
||||
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
'first_day_of_week' => 6,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
]);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
/*
|
||||
* Authors:
|
||||
* - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'formats' => [
|
||||
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
'first_day_of_week' => 6,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
]);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
/*
|
||||
* Authors:
|
||||
* - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'formats' => [
|
||||
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
'first_day_of_week' => 6,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
]);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
/*
|
||||
* Authors:
|
||||
* - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'formats' => [
|
||||
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
'first_day_of_week' => 6,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
]);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
* - JD Isaacks
|
||||
* - Atef Ben Ali (atefBB)
|
||||
* - Mohamed Sabil (mohamedsabil83)
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
$months = [
|
||||
'يناير',
|
||||
@@ -90,4 +91,5 @@ return [
|
||||
],
|
||||
'meridiem' => ['ص', 'م'],
|
||||
'weekend' => [5, 6],
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
];
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
/*
|
||||
* Authors:
|
||||
* - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'formats' => [
|
||||
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
'first_day_of_week' => 1,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
]);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
/*
|
||||
* Authors:
|
||||
* - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'formats' => [
|
||||
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
'first_day_of_week' => 6,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
]);
|
||||
|
||||
@@ -9,5 +9,10 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
]);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
/*
|
||||
* Authors:
|
||||
* - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'formats' => [
|
||||
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
'first_day_of_week' => 6,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
]);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* - JD Isaacks
|
||||
* - Atef Ben Ali (atefBB)
|
||||
* - Mohamed Sabil (mohamedsabil83)
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
$months = [
|
||||
'يناير',
|
||||
@@ -89,4 +90,5 @@ return [
|
||||
],
|
||||
'meridiem' => ['ص', 'م'],
|
||||
'weekend' => [5, 6],
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
];
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
/*
|
||||
* Authors:
|
||||
* - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'formats' => [
|
||||
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
'first_day_of_week' => 6,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
]);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
/*
|
||||
* Authors:
|
||||
* - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'formats' => [
|
||||
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
'first_day_of_week' => 6,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
]);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
/*
|
||||
* Authors:
|
||||
* - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org
|
||||
* - Abdullah-Alhariri
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'formats' => [
|
||||
@@ -23,4 +24,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
|
||||
'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
|
||||
]);
|
||||
|
||||
+3
-4
@@ -9,13 +9,12 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
|
||||
use Carbon\CarbonInterface;
|
||||
use Symfony\Component\Translation\PluralizationRules;
|
||||
|
||||
if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) {
|
||||
PluralizationRules::set(function ($number) {
|
||||
// @codeCoverageIgnoreStart
|
||||
if (class_exists(PluralizationRules::class)) {
|
||||
PluralizationRules::set(static function ($number) {
|
||||
return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
|
||||
}, 'be');
|
||||
}
|
||||
|
||||
@@ -9,5 +9,15 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Component\Translation\PluralizationRules;
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
if (class_exists(PluralizationRules::class)) {
|
||||
PluralizationRules::set(static function ($number) {
|
||||
return PluralizationRules::get($number, 'ca');
|
||||
}, 'ca_ES_Valencia');
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/ca.php', [
|
||||
]);
|
||||
|
||||
@@ -11,4 +11,12 @@
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'first_day_of_week' => 1,
|
||||
'formats' => [
|
||||
'LT' => 'HH:mm',
|
||||
'LTS' => 'HH:mm:ss',
|
||||
'L' => 'DD.MM.YYYY',
|
||||
'LL' => 'D MMMM YYYY',
|
||||
'LLL' => 'D MMMM YYYY HH:mm',
|
||||
'LLLL' => 'dddd D MMMM YYYY HH:mm',
|
||||
],
|
||||
]);
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ return [
|
||||
'second_before' => ':count másodperccel',
|
||||
's_before' => ':count másodperccel',
|
||||
'months' => ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'],
|
||||
'months_short' => ['jan.', 'feb.', 'márc.', 'ápr.', 'máj.', 'jún.', 'júl.', 'aug.', 'szept.', 'okt.', 'nov.', 'dec.'],
|
||||
'months_short' => ['jan.', 'febr.', 'márc.', 'ápr.', 'máj.', 'jún.', 'júl.', 'aug.', 'szept.', 'okt.', 'nov.', 'dec.'],
|
||||
'weekdays' => ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'],
|
||||
'weekdays_short' => ['vas', 'hét', 'kedd', 'sze', 'csüt', 'pén', 'szo'],
|
||||
'weekdays_min' => ['v', 'h', 'k', 'sze', 'cs', 'p', 'sz'],
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ return [
|
||||
'ago' => ':time yang lepas',
|
||||
'from_now' => ':time dari sekarang',
|
||||
'after' => ':time kemudian',
|
||||
'before' => ':time lepas',
|
||||
'before' => ':time sebelum',
|
||||
'diff_now' => 'sekarang',
|
||||
'diff_today' => 'Hari',
|
||||
'diff_today_regexp' => 'Hari(?:\\s+ini)?(?:\\s+pukul)?',
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
use Symfony\Component\Translation\PluralizationRules;
|
||||
|
||||
if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) {
|
||||
PluralizationRules::set(function ($number) {
|
||||
PluralizationRules::set(static function ($number) {
|
||||
return $number == 1 ? 0 : 1;
|
||||
}, 'oc');
|
||||
}
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ return [
|
||||
},
|
||||
'after' => ':time po',
|
||||
'before' => ':time przed',
|
||||
'diff_now' => 'przed chwilą',
|
||||
'diff_now' => 'teraz',
|
||||
'diff_today' => 'Dziś',
|
||||
'diff_today_regexp' => 'Dziś(?:\\s+o)?',
|
||||
'diff_yesterday' => 'wczoraj',
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
use Symfony\Component\Translation\PluralizationRules;
|
||||
|
||||
if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) {
|
||||
PluralizationRules::set(function ($number) {
|
||||
PluralizationRules::set(static function ($number) {
|
||||
return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
|
||||
}, 'sh');
|
||||
}
|
||||
|
||||
+91
-19
@@ -33,33 +33,87 @@
|
||||
* - Marek Adamický
|
||||
* - AlterwebStudio
|
||||
*/
|
||||
|
||||
use Carbon\CarbonInterface;
|
||||
|
||||
$fromNow = function ($time) {
|
||||
return 'o '.strtr($time, [
|
||||
'hodina' => 'hodinu',
|
||||
'minúta' => 'minútu',
|
||||
'sekunda' => 'sekundu',
|
||||
]);
|
||||
};
|
||||
|
||||
$ago = function ($time) {
|
||||
$replacements = [
|
||||
'/\bhodina\b/' => 'hodinou',
|
||||
'/\bminúta\b/' => 'minútou',
|
||||
'/\bsekunda\b/' => 'sekundou',
|
||||
'/\bdeň\b/u' => 'dňom',
|
||||
'/\btýždeň\b/u' => 'týždňom',
|
||||
'/\bmesiac\b/' => 'mesiacom',
|
||||
'/\brok\b/' => 'rokom',
|
||||
];
|
||||
|
||||
$replacementsPlural = [
|
||||
'/\bhodiny\b/' => 'hodinami',
|
||||
'/\bminúty\b/' => 'minútami',
|
||||
'/\bsekundy\b/' => 'sekundami',
|
||||
'/\bdni\b/' => 'dňami',
|
||||
'/\btýždne\b/' => 'týždňami',
|
||||
'/\bmesiace\b/' => 'mesiacmi',
|
||||
'/\broky\b/' => 'rokmi',
|
||||
];
|
||||
|
||||
foreach ($replacements + $replacementsPlural as $pattern => $replacement) {
|
||||
$time = preg_replace($pattern, $replacement, $time);
|
||||
}
|
||||
|
||||
return "pred $time";
|
||||
};
|
||||
|
||||
return [
|
||||
'year' => 'rok|:count roky|:count rokov',
|
||||
'year' => ':count rok|:count roky|:count rokov',
|
||||
'a_year' => 'rok|:count roky|:count rokov',
|
||||
'y' => ':count r',
|
||||
'month' => 'mesiac|:count mesiace|:count mesiacov',
|
||||
'month' => ':count mesiac|:count mesiace|:count mesiacov',
|
||||
'a_month' => 'mesiac|:count mesiace|:count mesiacov',
|
||||
'm' => ':count m',
|
||||
'week' => 'týždeň|:count týždne|:count týždňov',
|
||||
'week' => ':count týždeň|:count týždne|:count týždňov',
|
||||
'a_week' => 'týždeň|:count týždne|:count týždňov',
|
||||
'w' => ':count t',
|
||||
'day' => 'deň|:count dni|:count dní',
|
||||
'day' => ':count deň|:count dni|:count dní',
|
||||
'a_day' => 'deň|:count dni|:count dní',
|
||||
'd' => ':count d',
|
||||
'hour' => 'hodinu|:count hodiny|:count hodín',
|
||||
'hour' => ':count hodina|:count hodiny|:count hodín',
|
||||
'a_hour' => 'hodina|:count hodiny|:count hodín',
|
||||
'h' => ':count h',
|
||||
'minute' => 'minútu|:count minúty|:count minút',
|
||||
'minute' => ':count minúta|:count minúty|:count minút',
|
||||
'a_minute' => 'minúta|:count minúty|:count minút',
|
||||
'min' => ':count min',
|
||||
'second' => 'sekundu|:count sekundy|:count sekúnd',
|
||||
'a_second' => 'pár sekúnd|:count sekundy|:count sekúnd',
|
||||
'second' => ':count sekunda|:count sekundy|:count sekúnd',
|
||||
'a_second' => 'sekunda|:count sekundy|:count sekúnd',
|
||||
's' => ':count s',
|
||||
'ago' => 'pred :time',
|
||||
'from_now' => 'o :time',
|
||||
'after' => ':time po',
|
||||
'millisecond' => ':count milisekunda|:count milisekundy|:count milisekúnd',
|
||||
'a_millisecond' => 'milisekunda|:count milisekundy|:count milisekúnd',
|
||||
'ms' => ':count ms',
|
||||
'microsecond' => ':count mikrosekunda|:count mikrosekundy|:count mikrosekúnd',
|
||||
'a_microsecond' => 'mikrosekunda|:count mikrosekundy|:count mikrosekúnd',
|
||||
'µs' => ':count µs',
|
||||
|
||||
'ago' => $ago,
|
||||
'from_now' => $fromNow,
|
||||
'before' => ':time pred',
|
||||
'year_ago' => 'rokom|:count rokmi|:count rokmi',
|
||||
'month_ago' => 'mesiacom|:count mesiacmi|:count mesiacmi',
|
||||
'week_ago' => 'týždňom|:count týždňami|:count týždňami',
|
||||
'day_ago' => 'dňom|:count dňami|:count dňami',
|
||||
'hour_ago' => 'hodinou|:count hodinami|:count hodinami',
|
||||
'minute_ago' => 'minútou|:count minútami|:count minútami',
|
||||
'second_ago' => 'sekundou|:count sekundami|:count sekundami',
|
||||
'after' => ':time po',
|
||||
|
||||
'hour_after' => ':count hodinu|:count hodiny|:count hodín',
|
||||
'minute_after' => ':count minútu|:count minúty|:count minút',
|
||||
'second_after' => ':count sekundu|:count sekundy|:count sekúnd',
|
||||
|
||||
'hour_before' => ':count hodinu|:count hodiny|:count hodín',
|
||||
'minute_before' => ':count minútu|:count minúty|:count minút',
|
||||
'second_before' => ':count sekundu|:count sekundy|:count sekúnd',
|
||||
|
||||
'first_day_of_week' => 1,
|
||||
'day_of_first_week_of_year' => 4,
|
||||
'list' => [', ', ' a '],
|
||||
@@ -74,8 +128,26 @@ return [
|
||||
'LLL' => 'D. M. HH:mm',
|
||||
'LLLL' => 'dddd D. MMMM YYYY HH:mm',
|
||||
],
|
||||
'calendar' => [
|
||||
'sameDay' => '[dnes o] LT',
|
||||
'nextDay' => '[zajtra o] LT',
|
||||
'lastDay' => '[včera o] LT',
|
||||
'nextWeek' => 'dddd [o] LT',
|
||||
'lastWeek' => static function (CarbonInterface $date) {
|
||||
switch ($date->dayOfWeek) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 4:
|
||||
case 5:
|
||||
return '[minulý] dddd [o] LT'; //pondelok/utorok/štvrtok/piatok
|
||||
default:
|
||||
return '[minulá] dddd [o] LT';
|
||||
}
|
||||
},
|
||||
'sameElse' => 'L',
|
||||
],
|
||||
'weekdays' => ['nedeľa', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota'],
|
||||
'weekdays_short' => ['ned', 'pod', 'uto', 'str', 'štv', 'pia', 'sob'],
|
||||
'weekdays_short' => ['ned', 'pon', 'uto', 'str', 'štv', 'pia', 'sob'],
|
||||
'weekdays_min' => ['ne', 'po', 'ut', 'st', 'št', 'pi', 'so'],
|
||||
'months' => ['január', 'február', 'marec', 'apríl', 'máj', 'jún', 'júl', 'august', 'september', 'október', 'november', 'december'],
|
||||
'months_short' => ['jan', 'feb', 'mar', 'apr', 'máj', 'jún', 'júl', 'aug', 'sep', 'okt', 'nov', 'dec'],
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ return [
|
||||
|
||||
'year_ago' => ':count letom|:count letoma|:count leti|:count leti',
|
||||
'y_ago' => ':count letom|:count letoma|:count leti|:count leti',
|
||||
'month_ago' => ':count mesecem|:count meseci|:count meseci|:count meseci',
|
||||
'month_ago' => ':count mesecem|:count mesecema|:count meseci|:count meseci',
|
||||
'week_ago' => ':count tednom|:count tednoma|:count tedni|:count tedni',
|
||||
'day_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi',
|
||||
'd_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi',
|
||||
|
||||
+11
-11
@@ -24,28 +24,28 @@
|
||||
use Carbon\CarbonInterface;
|
||||
|
||||
return [
|
||||
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
|
||||
'year' => ':count година|:count године|:count година',
|
||||
'y' => ':count г.',
|
||||
'month' => '{1}:count месец|{2,3,4}:count месеца|[0,Inf[:count месеци',
|
||||
'month' => ':count месец|:count месеца|:count месеци',
|
||||
'm' => ':count м.',
|
||||
'week' => '{1}:count недеља|{2,3,4}:count недеље|[0,Inf[:count недеља',
|
||||
'week' => ':count недеља|:count недеље|:count недеља',
|
||||
'w' => ':count нед.',
|
||||
'day' => '{1,21,31}:count дан|[0,Inf[:count дана',
|
||||
'day' => ':count дан|:count дана|:count дана',
|
||||
'd' => ':count д.',
|
||||
'hour' => '{1,21}:count сат|{2,3,4,22,23,24}:count сата|[0,Inf[:count сати',
|
||||
'hour' => ':count сат|:count сата|:count сати',
|
||||
'h' => ':count ч.',
|
||||
'minute' => '{1,21,31,41,51}:count минут|[0,Inf[:count минута',
|
||||
'minute' => ':count минут|:count минута|:count минута',
|
||||
'min' => ':count мин.',
|
||||
'second' => '{1,21,31,41,51}:count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[0,Inf[:count секунди',
|
||||
'second' => ':count секунд|:count секунде|:count секунди',
|
||||
's' => ':count сек.',
|
||||
'ago' => 'пре :time',
|
||||
'from_now' => 'за :time',
|
||||
'after' => ':time након',
|
||||
'before' => ':time пре',
|
||||
'year_from_now' => '{1,21,31,41,51}:count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
|
||||
'year_ago' => '{1,21,31,41,51}:count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
|
||||
'week_from_now' => '{1}:count недељу|{2,3,4}:count недеље|[0,Inf[:count недеља',
|
||||
'week_ago' => '{1}:count недељу|{2,3,4}:count недеље|[0,Inf[:count недеља',
|
||||
'year_from_now' => ':count годину|:count године|:count година',
|
||||
'year_ago' => ':count годину|:count године|:count година',
|
||||
'week_from_now' => ':count недељу|:count недеље|:count недеља',
|
||||
'week_ago' => ':count недељу|:count недеље|:count недеља',
|
||||
'diff_now' => 'управо сада',
|
||||
'diff_today' => 'данас',
|
||||
'diff_today_regexp' => 'данас(?:\\s+у)?',
|
||||
|
||||
@@ -9,6 +9,16 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Component\Translation\PluralizationRules;
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
if (class_exists(PluralizationRules::class)) {
|
||||
PluralizationRules::set(static function ($number) {
|
||||
return PluralizationRules::get($number, 'sr');
|
||||
}, 'sr_Cyrl_BA');
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/sr_Cyrl.php', [
|
||||
'formats' => [
|
||||
'LT' => 'HH:mm',
|
||||
|
||||
+20
-11
@@ -16,32 +16,41 @@
|
||||
*/
|
||||
|
||||
use Carbon\CarbonInterface;
|
||||
use Symfony\Component\Translation\PluralizationRules;
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
if (class_exists(PluralizationRules::class)) {
|
||||
PluralizationRules::set(static function ($number) {
|
||||
return PluralizationRules::get($number, 'sr');
|
||||
}, 'sr_Cyrl_ME');
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return [
|
||||
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
|
||||
'year' => ':count година|:count године|:count година',
|
||||
'y' => ':count г.',
|
||||
'month' => '{1}:count мјесец|{2,3,4}:count мјесеца|[0,Inf[:count мјесеци',
|
||||
'month' => ':count мјесец|:count мјесеца|:count мјесеци',
|
||||
'm' => ':count мј.',
|
||||
'week' => '{1}:count недјеља|{2,3,4}:count недјеље|[0,Inf[:count недјеља',
|
||||
'week' => ':count недјеља|:count недјеље|:count недјеља',
|
||||
'w' => ':count нед.',
|
||||
'day' => '{1,21,31}:count дан|[0,Inf[:count дана',
|
||||
'day' => ':count дан|:count дана|:count дана',
|
||||
'd' => ':count д.',
|
||||
'hour' => '{1,21}:count сат|{2,3,4,22,23,24}:count сата|[0,Inf[:count сати',
|
||||
'hour' => ':count сат|:count сата|:count сати',
|
||||
'h' => ':count ч.',
|
||||
'minute' => '{1,21,31,41,51}:count минут|[0,Inf[:count минута',
|
||||
'minute' => ':count минут|:count минута|:count минута',
|
||||
'min' => ':count мин.',
|
||||
'second' => '{1,21,31,41,51}:count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[0,Inf[:count секунди',
|
||||
'second' => ':count секунд|:count секунде|:count секунди',
|
||||
's' => ':count сек.',
|
||||
'ago' => 'прије :time',
|
||||
'from_now' => 'за :time',
|
||||
'after' => ':time након',
|
||||
'before' => ':time прије',
|
||||
|
||||
'year_from_now' => '{1,21,31,41,51}:count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
|
||||
'year_ago' => '{1,21,31,41,51}:count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
|
||||
'year_from_now' => ':count годину|:count године|:count година',
|
||||
'year_ago' => ':count годину|:count године|:count година',
|
||||
|
||||
'week_from_now' => '{1}:count недјељу|{2,3,4}:count недјеље|[0,Inf[:count недјеља',
|
||||
'week_ago' => '{1}:count недјељу|{2,3,4}:count недјеље|[0,Inf[:count недјеља',
|
||||
'week_from_now' => ':count недјељу|:count недјеље|:count недјеља',
|
||||
'week_ago' => ':count недјељу|:count недјеље|:count недјеља',
|
||||
|
||||
'diff_now' => 'управо сада',
|
||||
'diff_today' => 'данас',
|
||||
|
||||
@@ -9,6 +9,16 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Component\Translation\PluralizationRules;
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
if (class_exists(PluralizationRules::class)) {
|
||||
PluralizationRules::set(static function ($number) {
|
||||
return PluralizationRules::get($number, 'sr');
|
||||
}, 'sr_Cyrl_XK');
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/sr_Cyrl_BA.php', [
|
||||
'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'],
|
||||
]);
|
||||
|
||||
@@ -9,6 +9,16 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Component\Translation\PluralizationRules;
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
if (class_exists(PluralizationRules::class)) {
|
||||
PluralizationRules::set(static function ($number) {
|
||||
return PluralizationRules::get($number, 'sr');
|
||||
}, 'sr_Latn_BA');
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/sr_Latn.php', [
|
||||
'formats' => [
|
||||
'LT' => 'HH:mm',
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
*/
|
||||
|
||||
use Carbon\CarbonInterface;
|
||||
use Symfony\Component\Translation\PluralizationRules;
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
if (class_exists(PluralizationRules::class)) {
|
||||
PluralizationRules::set(static function ($number) {
|
||||
return PluralizationRules::get($number, 'sr');
|
||||
}, 'sr_Latn_ME');
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/sr.php', [
|
||||
'month' => ':count mjesec|:count mjeseca|:count mjeseci',
|
||||
@@ -27,6 +36,7 @@ return array_replace_recursive(require __DIR__.'/sr.php', [
|
||||
'before' => ':time prije',
|
||||
'week_from_now' => ':count nedjelju|:count nedjelje|:count nedjelja',
|
||||
'week_ago' => ':count nedjelju|:count nedjelje|:count nedjelja',
|
||||
'second_ago' => ':count sekund|:count sekunde|:count sekundi',
|
||||
'diff_tomorrow' => 'sjutra',
|
||||
'calendar' => [
|
||||
'nextDay' => '[sjutra u] LT',
|
||||
|
||||
@@ -9,6 +9,16 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Component\Translation\PluralizationRules;
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
if (class_exists(PluralizationRules::class)) {
|
||||
PluralizationRules::set(static function ($number) {
|
||||
return PluralizationRules::get($number, 'sr');
|
||||
}, 'sr_Latn_XK');
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return array_replace_recursive(require __DIR__.'/sr_Latn_BA.php', [
|
||||
'weekdays' => ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'],
|
||||
]);
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\MessageFormatter;
|
||||
|
||||
use ReflectionMethod;
|
||||
use Symfony\Component\Translation\Formatter\MessageFormatter;
|
||||
use Symfony\Component\Translation\Formatter\MessageFormatterInterface;
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
$transMethod = new ReflectionMethod(MessageFormatterInterface::class, 'format');
|
||||
|
||||
require $transMethod->getParameters()[0]->hasType()
|
||||
? __DIR__.'/../../../lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php'
|
||||
: __DIR__.'/../../../lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php';
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
final class MessageFormatterMapper extends LazyMessageFormatter
|
||||
{
|
||||
/**
|
||||
* Wrapped formatter.
|
||||
*
|
||||
* @var MessageFormatterInterface
|
||||
*/
|
||||
protected $formatter;
|
||||
|
||||
public function __construct(?MessageFormatterInterface $formatter = null)
|
||||
{
|
||||
$this->formatter = $formatter ?? new MessageFormatter();
|
||||
}
|
||||
|
||||
protected function transformLocale(?string $locale): ?string
|
||||
{
|
||||
return $locale ? preg_replace('/[_@][A-Za-z][a-z]{2,}/', '', $locale) : $locale;
|
||||
}
|
||||
}
|
||||
@@ -70,11 +70,9 @@ abstract class AbstractMacro implements BuiltinMethodReflection
|
||||
/**
|
||||
* Macro constructor.
|
||||
*
|
||||
* @param string $className
|
||||
* @phpstan-param class-string $className
|
||||
*
|
||||
* @param string $methodName
|
||||
* @param callable $macro
|
||||
* @param class-string $className
|
||||
* @param string $methodName
|
||||
* @param callable $macro
|
||||
*/
|
||||
public function __construct(string $className, string $methodName, $macro)
|
||||
{
|
||||
|
||||
@@ -36,10 +36,8 @@ final class MacroScanner
|
||||
/**
|
||||
* Return true if the given pair class-method is a Carbon macro.
|
||||
*
|
||||
* @param string $className
|
||||
* @phpstan-param class-string $className
|
||||
*
|
||||
* @param string $methodName
|
||||
* @param class-string $className
|
||||
* @param string $methodName
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
@@ -61,10 +59,8 @@ final class MacroScanner
|
||||
/**
|
||||
* Return the Macro for a given pair class-method.
|
||||
*
|
||||
* @param string $className
|
||||
* @phpstan-param class-string $className
|
||||
*
|
||||
* @param string $methodName
|
||||
* @param class-string $className
|
||||
* @param string $methodName
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*
|
||||
|
||||
+31
-5
@@ -563,12 +563,17 @@ trait Comparison
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the instance is a long year
|
||||
* Determines if the instance is a long year (using calendar year).
|
||||
*
|
||||
* ⚠️ This method completely ignores month and day to use the numeric year number,
|
||||
* it's not correct if the exact date matters. For instance as `2019-12-30` is already
|
||||
* in the first week of the 2020 year, if you want to know from this date if ISO week
|
||||
* year 2020 is a long year, use `isLongIsoYear` instead.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* Carbon::parse('2015-01-01')->isLongYear(); // true
|
||||
* Carbon::parse('2016-01-01')->isLongYear(); // false
|
||||
* Carbon::create(2015)->isLongYear(); // true
|
||||
* Carbon::create(2016)->isLongYear(); // false
|
||||
* ```
|
||||
*
|
||||
* @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates
|
||||
@@ -580,6 +585,27 @@ trait Comparison
|
||||
return static::create($this->year, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the instance is a long year (using ISO 8601 year).
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* Carbon::parse('2015-01-01')->isLongIsoYear(); // true
|
||||
* Carbon::parse('2016-01-01')->isLongIsoYear(); // true
|
||||
* Carbon::parse('2016-01-03')->isLongIsoYear(); // false
|
||||
* Carbon::parse('2019-12-29')->isLongIsoYear(); // false
|
||||
* Carbon::parse('2019-12-30')->isLongIsoYear(); // true
|
||||
* ```
|
||||
*
|
||||
* @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isLongIsoYear()
|
||||
{
|
||||
return static::create($this->isoWeekYear, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares the formatted values of the two dates.
|
||||
*
|
||||
@@ -996,12 +1022,12 @@ trait Comparison
|
||||
return $current->startOfMinute()->eq($other);
|
||||
}
|
||||
|
||||
if (preg_match('/\d(h|am|pm)$/', $tester)) {
|
||||
if (preg_match('/\d(?:h|am|pm)$/', $tester)) {
|
||||
return $current->startOfHour()->eq($other);
|
||||
}
|
||||
|
||||
if (preg_match(
|
||||
'/^(january|february|march|april|may|june|july|august|september|october|november|december)\s+\d+$/i',
|
||||
'/^(?:january|february|march|april|may|june|july|august|september|october|november|december)(?:\s+\d+)?$/i',
|
||||
$tester
|
||||
)) {
|
||||
return $current->startOfMonth()->eq($other->startOfMonth());
|
||||
|
||||
+7
-4
@@ -16,6 +16,7 @@ use Carbon\CarbonImmutable;
|
||||
use Carbon\CarbonInterface;
|
||||
use Carbon\CarbonInterval;
|
||||
use Carbon\CarbonPeriod;
|
||||
use Carbon\CarbonPeriodImmutable;
|
||||
use Carbon\Exceptions\UnitException;
|
||||
use Closure;
|
||||
use DateTime;
|
||||
@@ -605,16 +606,18 @@ trait Converter
|
||||
$interval = CarbonInterval::make("$interval ".static::pluralUnit($unit));
|
||||
}
|
||||
|
||||
$period = (new CarbonPeriod())->setDateClass(static::class)->setStartDate($this);
|
||||
$period = ($this->isMutable() ? new CarbonPeriod() : new CarbonPeriodImmutable())
|
||||
->setDateClass(static::class)
|
||||
->setStartDate($this);
|
||||
|
||||
if ($interval) {
|
||||
$period->setDateInterval($interval);
|
||||
$period = $period->setDateInterval($interval);
|
||||
}
|
||||
|
||||
if (\is_int($end) || (\is_string($end) && ctype_digit($end))) {
|
||||
$period->setRecurrences($end);
|
||||
$period = $period->setRecurrences($end);
|
||||
} elseif ($end) {
|
||||
$period->setEndDate($end);
|
||||
$period = $period->setEndDate($end);
|
||||
}
|
||||
|
||||
return $period;
|
||||
|
||||
+39
-12
@@ -19,6 +19,8 @@ use Carbon\Exceptions\InvalidFormatException;
|
||||
use Carbon\Exceptions\OutOfRangeException;
|
||||
use Carbon\Translator;
|
||||
use Closure;
|
||||
use DateMalformedStringException;
|
||||
use DateTimeImmutable;
|
||||
use DateTimeInterface;
|
||||
use DateTimeZone;
|
||||
use Exception;
|
||||
@@ -112,7 +114,7 @@ trait Creator
|
||||
$safeTz = static::safeCreateDateTimeZone($tz);
|
||||
|
||||
if ($safeTz) {
|
||||
return $date->setTimezone($safeTz);
|
||||
return ($date instanceof DateTimeImmutable ? $date : clone $date)->setTimezone($safeTz);
|
||||
}
|
||||
|
||||
return $date;
|
||||
@@ -184,7 +186,13 @@ trait Creator
|
||||
try {
|
||||
return new static($time, $tz);
|
||||
} catch (Exception $exception) {
|
||||
$date = @static::now($tz)->change($time);
|
||||
// @codeCoverageIgnoreStart
|
||||
try {
|
||||
$date = @static::now($tz)->change($time);
|
||||
} catch (DateMalformedStringException $ignoredException) {
|
||||
$date = null;
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
if (!$date) {
|
||||
throw new InvalidFormatException("Could not parse '$time': ".$exception->getMessage(), 0, $exception);
|
||||
@@ -354,13 +362,13 @@ trait Creator
|
||||
* If $hour is not null then the default values for $minute and $second
|
||||
* will be 0.
|
||||
*
|
||||
* @param int|null $year
|
||||
* @param int|null $month
|
||||
* @param int|null $day
|
||||
* @param int|null $hour
|
||||
* @param int|null $minute
|
||||
* @param int|null $second
|
||||
* @param DateTimeZone|string|null $tz
|
||||
* @param DateTimeInterface|int|null $year
|
||||
* @param int|null $month
|
||||
* @param int|null $day
|
||||
* @param int|null $hour
|
||||
* @param int|null $minute
|
||||
* @param int|null $second
|
||||
* @param DateTimeZone|string|null $tz
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
@@ -634,6 +642,10 @@ trait Creator
|
||||
$time = preg_replace('/^(.*)(am|pm|AM|PM)(.*)$/U', '$1$3 $2', $time);
|
||||
}
|
||||
|
||||
if ($tz === false) {
|
||||
$tz = null;
|
||||
}
|
||||
|
||||
// First attempt to create an instance, so that error messages are based on the unmodified format.
|
||||
$date = self::createFromFormatAndTimezone($format, $time, $tz);
|
||||
$lastErrors = parent::getLastErrors();
|
||||
@@ -651,12 +663,14 @@ trait Creator
|
||||
$tz = clone $mock->getTimezone();
|
||||
}
|
||||
|
||||
// Set microseconds to zero to match behavior of DateTime::createFromFormat()
|
||||
// See https://bugs.php.net/bug.php?id=74332
|
||||
$mock = $mock->copy()->microsecond(0);
|
||||
$mock = $mock->copy();
|
||||
|
||||
// Prepend mock datetime only if the format does not contain non escaped unix epoch reset flag.
|
||||
if (!preg_match("/{$nonEscaped}[!|]/", $format)) {
|
||||
if (preg_match('/[HhGgisvuB]/', $format)) {
|
||||
$mock = $mock->setTime(0, 0);
|
||||
}
|
||||
|
||||
$format = static::MOCK_DATETIME_FORMAT.' '.$format;
|
||||
$time = ($mock instanceof self ? $mock->rawFormat(static::MOCK_DATETIME_FORMAT) : $mock->format(static::MOCK_DATETIME_FORMAT)).' '.$time;
|
||||
}
|
||||
@@ -862,6 +876,19 @@ trait Creator
|
||||
*/
|
||||
public static function createFromLocaleFormat($format, $locale, $time, $tz = null)
|
||||
{
|
||||
$format = preg_replace_callback(
|
||||
'/(?:\\\\[a-zA-Z]|[bfkqCEJKQRV]){2,}/',
|
||||
static function (array $match) use ($locale): string {
|
||||
$word = str_replace('\\', '', $match[0]);
|
||||
$translatedWord = static::translateTimeString($word, $locale, 'en');
|
||||
|
||||
return $word === $translatedWord
|
||||
? $match[0]
|
||||
: preg_replace('/[a-zA-Z]/', '\\\\$0', $translatedWord);
|
||||
},
|
||||
$format
|
||||
);
|
||||
|
||||
return static::rawCreateFromFormat($format, static::translateTimeString($time, $locale, 'en'), $tz);
|
||||
}
|
||||
|
||||
|
||||
@@ -2310,6 +2310,7 @@ trait Date
|
||||
'c' => true,
|
||||
'r' => true,
|
||||
'U' => true,
|
||||
'T' => true,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -298,9 +298,9 @@ trait Difference
|
||||
*/
|
||||
public function diffInWeekdays($date = null, $absolute = true)
|
||||
{
|
||||
return $this->diffInDaysFiltered(function (CarbonInterface $date) {
|
||||
return $this->diffInDaysFiltered(static function (CarbonInterface $date) {
|
||||
return $date->isWeekday();
|
||||
}, $date, $absolute);
|
||||
}, $this->resolveCarbon($date)->avoidMutation()->modify($this->format('H:i:s.u')), $absolute);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -313,9 +313,9 @@ trait Difference
|
||||
*/
|
||||
public function diffInWeekendDays($date = null, $absolute = true)
|
||||
{
|
||||
return $this->diffInDaysFiltered(function (CarbonInterface $date) {
|
||||
return $this->diffInDaysFiltered(static function (CarbonInterface $date) {
|
||||
return $date->isWeekend();
|
||||
}, $date, $absolute);
|
||||
}, $this->resolveCarbon($date)->avoidMutation()->modify($this->format('H:i:s.u')), $absolute);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -844,7 +844,7 @@ trait Difference
|
||||
$parts = min(7, max(1, (int) $parts));
|
||||
$skip = \is_array($syntax) ? ($syntax['skip'] ?? []) : [];
|
||||
|
||||
return $this->diffAsCarbonInterval($other, false, $skip)
|
||||
return $this->diffAsCarbonInterval($other, false, (array) $skip)
|
||||
->setLocalTranslator($this->getLocalTranslator())
|
||||
->forHumans($syntax, (bool) $short, $parts, $options ?? $this->localHumanDiffOptions ?? static::getHumanDiffOptions());
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ trait IntervalRounding
|
||||
$unit = 'second';
|
||||
|
||||
if ($precision instanceof DateInterval) {
|
||||
$precision = (string) CarbonInterval::instance($precision);
|
||||
$precision = (string) CarbonInterval::instance($precision, [], true);
|
||||
}
|
||||
|
||||
if (\is_string($precision) && preg_match('/^\s*(?<precision>\d+)?\s*(?<unit>\w+)(?<other>\W.*)?$/', $precision, $match)) {
|
||||
|
||||
@@ -23,6 +23,7 @@ use Symfony\Component\Translation\TranslatorInterface;
|
||||
use Symfony\Contracts\Translation\LocaleAwareInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface as ContractsTranslatorInterface;
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
if (interface_exists('Symfony\\Contracts\\Translation\\TranslatorInterface') &&
|
||||
!interface_exists('Symfony\\Component\\Translation\\TranslatorInterface')
|
||||
) {
|
||||
@@ -31,6 +32,7 @@ if (interface_exists('Symfony\\Contracts\\Translation\\TranslatorInterface') &&
|
||||
'Symfony\\Component\\Translation\\TranslatorInterface'
|
||||
);
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
/**
|
||||
* Trait Localization.
|
||||
|
||||
+51
-16
@@ -11,6 +11,9 @@
|
||||
|
||||
namespace Carbon\Traits;
|
||||
|
||||
use Carbon\CarbonInterface;
|
||||
use Carbon\CarbonInterval;
|
||||
use Carbon\CarbonPeriod;
|
||||
use Closure;
|
||||
use Generator;
|
||||
use ReflectionClass;
|
||||
@@ -99,12 +102,13 @@ trait Mixin
|
||||
{
|
||||
$context = eval(self::getAnonymousClassCodeForTrait($trait));
|
||||
$className = \get_class($context);
|
||||
$baseClass = static::class;
|
||||
|
||||
foreach (self::getMixableMethods($context) as $name) {
|
||||
$closureBase = Closure::fromCallable([$context, $name]);
|
||||
|
||||
static::macro($name, function () use ($closureBase, $className) {
|
||||
/** @phpstan-ignore-next-line */
|
||||
static::macro($name, function (...$parameters) use ($closureBase, $className, $baseClass) {
|
||||
$downContext = isset($this) ? ($this) : new $baseClass();
|
||||
$context = isset($this) ? $this->cast($className) : new $className();
|
||||
|
||||
try {
|
||||
@@ -117,7 +121,48 @@ trait Mixin
|
||||
// in case of errors not converted into exceptions
|
||||
$closure = $closure ?: $closureBase;
|
||||
|
||||
return $closure(...\func_get_args());
|
||||
$result = $closure(...$parameters);
|
||||
|
||||
if (!($result instanceof $className)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
if ($downContext instanceof CarbonInterface && $result instanceof CarbonInterface) {
|
||||
if ($context !== $result) {
|
||||
$downContext = $downContext->copy();
|
||||
}
|
||||
|
||||
return $downContext
|
||||
->setTimezone($result->getTimezone())
|
||||
->modify($result->format('Y-m-d H:i:s.u'))
|
||||
->settings($result->getSettings());
|
||||
}
|
||||
|
||||
if ($downContext instanceof CarbonInterval && $result instanceof CarbonInterval) {
|
||||
if ($context !== $result) {
|
||||
$downContext = $downContext->copy();
|
||||
}
|
||||
|
||||
$downContext->copyProperties($result);
|
||||
self::copyStep($downContext, $result);
|
||||
self::copyNegativeUnits($downContext, $result);
|
||||
|
||||
return $downContext->settings($result->getSettings());
|
||||
}
|
||||
|
||||
if ($downContext instanceof CarbonPeriod && $result instanceof CarbonPeriod) {
|
||||
if ($context !== $result) {
|
||||
$downContext = $downContext->copy();
|
||||
}
|
||||
|
||||
return $downContext
|
||||
->setDates($result->getStartDate(), $result->getEndDate())
|
||||
->setRecurrences($result->getRecurrences())
|
||||
->setOptions($result->getOptions())
|
||||
->settings($result->getSettings());
|
||||
}
|
||||
|
||||
return $result;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -151,22 +196,12 @@ trait Mixin
|
||||
protected static function bindMacroContext($context, callable $callable)
|
||||
{
|
||||
static::$macroContextStack[] = $context;
|
||||
$exception = null;
|
||||
$result = null;
|
||||
|
||||
try {
|
||||
$result = $callable();
|
||||
} catch (Throwable $throwable) {
|
||||
$exception = $throwable;
|
||||
return $callable();
|
||||
} finally {
|
||||
array_pop(static::$macroContextStack);
|
||||
}
|
||||
|
||||
array_pop(static::$macroContextStack);
|
||||
|
||||
if ($exception) {
|
||||
throw $exception;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-3
@@ -75,7 +75,7 @@ trait Modifiers
|
||||
*
|
||||
* @param string|int|null $modifier
|
||||
*
|
||||
* @return static
|
||||
* @return static|false
|
||||
*/
|
||||
public function next($modifier = null)
|
||||
{
|
||||
@@ -157,7 +157,7 @@ trait Modifiers
|
||||
*
|
||||
* @param string|int|null $modifier
|
||||
*
|
||||
* @return static
|
||||
* @return static|false
|
||||
*/
|
||||
public function previous($modifier = null)
|
||||
{
|
||||
@@ -451,7 +451,7 @@ trait Modifiers
|
||||
*
|
||||
* @param string $modifier
|
||||
*
|
||||
* @return static
|
||||
* @return static|false
|
||||
*/
|
||||
public function change($modifier)
|
||||
{
|
||||
|
||||
+4
-4
@@ -22,7 +22,7 @@ use Throwable;
|
||||
*
|
||||
* Depends on the following methods:
|
||||
*
|
||||
* @method \Carbon\Carbon|\Carbon\CarbonImmutable shiftTimezone($timezone) Set the timezone
|
||||
* @method static shiftTimezone($timezone) Set the timezone
|
||||
*/
|
||||
trait Options
|
||||
{
|
||||
@@ -422,7 +422,7 @@ trait Options
|
||||
foreach ($map as $property => $key) {
|
||||
$value = $this->$property ?? null;
|
||||
|
||||
if ($value !== null) {
|
||||
if ($value !== null && ($key !== 'locale' || $value !== 'en' || $this->localTranslator)) {
|
||||
$settings[$key] = $value;
|
||||
}
|
||||
}
|
||||
@@ -437,11 +437,11 @@ trait Options
|
||||
*/
|
||||
public function __debugInfo()
|
||||
{
|
||||
$infos = array_filter(get_object_vars($this), function ($var) {
|
||||
$infos = array_filter(get_object_vars($this), static function ($var) {
|
||||
return $var;
|
||||
});
|
||||
|
||||
foreach (['dumpProperties', 'constructedObjectId'] as $property) {
|
||||
foreach (['dumpProperties', 'constructedObjectId', 'constructed'] as $property) {
|
||||
if (isset($infos[$property])) {
|
||||
unset($infos[$property]);
|
||||
}
|
||||
|
||||
+2
-6
@@ -57,7 +57,6 @@ trait Rounding
|
||||
'microsecond' => [0, 999999],
|
||||
]);
|
||||
$factor = 1;
|
||||
$initialMonth = $this->month;
|
||||
|
||||
if ($normalizedUnit === 'week') {
|
||||
$normalizedUnit = 'day';
|
||||
@@ -130,16 +129,13 @@ trait Rounding
|
||||
$normalizedValue = floor($function(($value - $minimum) / $precision) * $precision + $minimum);
|
||||
|
||||
/** @var CarbonInterface $result */
|
||||
$result = $this->$normalizedUnit($normalizedValue);
|
||||
$result = $this;
|
||||
|
||||
foreach ($changes as $unit => $value) {
|
||||
$result = $result->$unit($value);
|
||||
}
|
||||
|
||||
return $normalizedUnit === 'month' && $precision <= 1 && abs($result->month - $initialMonth) === 2
|
||||
// Re-run the change in case an overflow occurred
|
||||
? $result->$normalizedUnit($normalizedValue)
|
||||
: $result;
|
||||
return $result->$normalizedUnit($normalizedValue);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+23
-1
@@ -120,6 +120,8 @@ trait Serialization
|
||||
/**
|
||||
* Returns the list of properties to dump on serialize() called on.
|
||||
*
|
||||
* Only used by PHP < 7.4.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
@@ -134,15 +136,24 @@ trait Serialization
|
||||
return $properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the values to dump on serialize() called on.
|
||||
*
|
||||
* Only used by PHP >= 7.4.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function __serialize(): array
|
||||
{
|
||||
if (isset($this->timezone_type)) {
|
||||
// @codeCoverageIgnoreStart
|
||||
if (isset($this->timezone_type, $this->timezone, $this->date)) {
|
||||
return [
|
||||
'date' => $this->date ?? null,
|
||||
'timezone_type' => $this->timezone_type,
|
||||
'timezone' => $this->timezone ?? null,
|
||||
];
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
$timezone = $this->getTimezone();
|
||||
$export = [
|
||||
@@ -170,6 +181,8 @@ trait Serialization
|
||||
/**
|
||||
* Set locale if specified on unserialize() called.
|
||||
*
|
||||
* Only used by PHP < 7.4.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
@@ -201,6 +214,13 @@ trait Serialization
|
||||
$this->cleanupDumpProperties();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set locale if specified on unserialize() called.
|
||||
*
|
||||
* Only used by PHP >= 7.4.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __unserialize(array $data): void
|
||||
{
|
||||
// @codeCoverageIgnoreStart
|
||||
@@ -269,6 +289,7 @@ trait Serialization
|
||||
*/
|
||||
public function cleanupDumpProperties()
|
||||
{
|
||||
// @codeCoverageIgnoreStart
|
||||
if (PHP_VERSION < 8.2) {
|
||||
foreach ($this->dumpProperties as $property) {
|
||||
if (isset($this->$property)) {
|
||||
@@ -276,6 +297,7 @@ trait Serialization
|
||||
}
|
||||
}
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
+6
-4
@@ -119,12 +119,14 @@ trait Test
|
||||
*
|
||||
* /!\ Use this method for unit tests only.
|
||||
*
|
||||
* @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance
|
||||
* @param Closure|null $callback
|
||||
* @template T
|
||||
*
|
||||
* @return mixed
|
||||
* @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance
|
||||
* @param Closure(): T $callback
|
||||
*
|
||||
* @return T
|
||||
*/
|
||||
public static function withTestNow($testNow = null, $callback = null)
|
||||
public static function withTestNow($testNow, $callback)
|
||||
{
|
||||
static::setTestNow($testNow);
|
||||
|
||||
|
||||
@@ -38,16 +38,16 @@ trait ToStringFormat
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|Closure|null $format
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
|
||||
* You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and
|
||||
* use other method or custom format passed to format() method if you need to dump another string
|
||||
* format.
|
||||
*
|
||||
* Set the default format used when type juggling a Carbon instance to a string.
|
||||
*
|
||||
* @param string|Closure|null $format
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setToStringFormat($format)
|
||||
{
|
||||
|
||||
+14
-8
@@ -17,6 +17,7 @@ use Carbon\CarbonInterval;
|
||||
use Carbon\Exceptions\UnitException;
|
||||
use Closure;
|
||||
use DateInterval;
|
||||
use DateMalformedStringException;
|
||||
use ReturnTypeWillChange;
|
||||
|
||||
/**
|
||||
@@ -197,7 +198,7 @@ trait Units
|
||||
public function add($unit, $value = 1, $overflow = null)
|
||||
{
|
||||
if (\is_string($unit) && \func_num_args() === 1) {
|
||||
$unit = CarbonInterval::make($unit);
|
||||
$unit = CarbonInterval::make($unit, [], true);
|
||||
}
|
||||
|
||||
if ($unit instanceof CarbonConverterInterface) {
|
||||
@@ -304,12 +305,17 @@ trait Units
|
||||
$unit = 'second';
|
||||
$value = $second;
|
||||
}
|
||||
$date = $date->modify("$value $unit");
|
||||
|
||||
if (isset($timeString)) {
|
||||
$date = $date->setTimeFromTimeString($timeString);
|
||||
} elseif (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) {
|
||||
$date = $date->modify('last day of previous month');
|
||||
try {
|
||||
$date = $date->modify("$value $unit");
|
||||
|
||||
if (isset($timeString)) {
|
||||
$date = $date->setTimeFromTimeString($timeString);
|
||||
} elseif (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) {
|
||||
$date = $date->modify('last day of previous month');
|
||||
}
|
||||
} catch (DateMalformedStringException $ignoredException) { // @codeCoverageIgnore
|
||||
$date = null; // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
if (!$date) {
|
||||
@@ -362,7 +368,7 @@ trait Units
|
||||
public function sub($unit, $value = 1, $overflow = null)
|
||||
{
|
||||
if (\is_string($unit) && \func_num_args() === 1) {
|
||||
$unit = CarbonInterval::make($unit);
|
||||
$unit = CarbonInterval::make($unit, [], true);
|
||||
}
|
||||
|
||||
if ($unit instanceof CarbonConverterInterface) {
|
||||
@@ -398,7 +404,7 @@ trait Units
|
||||
public function subtract($unit, $value = 1, $overflow = null)
|
||||
{
|
||||
if (\is_string($unit) && \func_num_args() === 1) {
|
||||
$unit = CarbonInterval::make($unit);
|
||||
$unit = CarbonInterval::make($unit, [], true);
|
||||
}
|
||||
|
||||
return $this->sub($unit, $value, $overflow);
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ class TranslatorImmutable extends Translator
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory)
|
||||
public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory): void
|
||||
{
|
||||
$this->disallowMutation(__METHOD__);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user