mirror of
https://github.com/itflow-org/itflow
synced 2026-06-18 07:41:05 +00:00
Allow PHP-8.2 and up Compatibility instead of just PHP-8.4
This commit is contained in:
10
plugins/vendor/nesbot/carbon/composer.json
vendored
10
plugins/vendor/nesbot/carbon/composer.json
vendored
@@ -19,11 +19,11 @@
|
||||
"homepage": "https://github.com/kylekatarnls"
|
||||
}
|
||||
],
|
||||
"homepage": "https://carbon.nesbot.com",
|
||||
"homepage": "https://carbonphp.github.io/carbon/",
|
||||
"support": {
|
||||
"issues": "https://github.com/CarbonPHP/carbon/issues",
|
||||
"source": "https://github.com/CarbonPHP/carbon",
|
||||
"docs": "https://carbon.nesbot.com/docs"
|
||||
"docs": "https://carbonphp.github.io/carbon/guide/getting-started/introduction.html"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -44,9 +44,9 @@
|
||||
"ext-json": "*",
|
||||
"carbonphp/carbon-doctrine-types": "<100.0",
|
||||
"psr/clock": "^1.0",
|
||||
"symfony/clock": "^6.3.12 || ^7.0",
|
||||
"symfony/clock": "^6.3.12 || ^7.0 || ^8.0",
|
||||
"symfony/polyfill-mbstring": "^1.0",
|
||||
"symfony/translation": "^4.4.18 || ^5.2.1 || ^6.0 || ^7.0"
|
||||
"symfony/translation": "^4.4.18 || ^5.2.1 || ^6.0 || ^7.0 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/dbal": "^3.6.3 || ^4.0",
|
||||
@@ -57,7 +57,7 @@
|
||||
"phpstan/extension-installer": "^1.4.3",
|
||||
"phpstan/phpstan": "^2.1.22",
|
||||
"phpunit/phpunit": "^10.5.53",
|
||||
"squizlabs/php_codesniffer": "^3.13.4"
|
||||
"squizlabs/php_codesniffer": "^3.13.4 || ^4.0.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/clock-implementation": "1.0"
|
||||
|
||||
4
plugins/vendor/nesbot/carbon/extension.neon
vendored
4
plugins/vendor/nesbot/carbon/extension.neon
vendored
@@ -1,3 +1,7 @@
|
||||
parameters:
|
||||
bootstrapFiles:
|
||||
- lazy/Carbon/UnprotectedDatePeriod.php
|
||||
|
||||
services:
|
||||
-
|
||||
class: Carbon\PHPStan\MacroExtension
|
||||
|
||||
81
plugins/vendor/nesbot/carbon/readme.md
vendored
81
plugins/vendor/nesbot/carbon/readme.md
vendored
@@ -5,7 +5,7 @@
|
||||
[](https://github.com/CarbonPHP/carbon/actions)
|
||||
[](https://codecov.io/github/CarbonPHP/carbon/actions?branch=master)
|
||||
|
||||
An international PHP extension for DateTime. [https://carbon.nesbot.com](https://carbon.nesbot.com)
|
||||
An international PHP extension for DateTime. [Documentation](https://carbonphp.github.io/carbon/)
|
||||
|
||||
> [!NOTE]
|
||||
> We're migrating the repository from [briannesbitt/Carbon](https://github.com/briannesbitt/Carbon) to [CarbonPHP/carbon](https://github.com/CarbonPHP/carbon),
|
||||
@@ -102,7 +102,7 @@ printf("Now: %s", Carbon::now());
|
||||
|
||||
## Documentation
|
||||
|
||||
[https://carbon.nesbot.com/docs](https://carbon.nesbot.com/docs)
|
||||
[https://carbonphp.github.io/carbon/](https://carbonphp.github.io/carbon/)
|
||||
|
||||
## Security contact information
|
||||
|
||||
@@ -120,53 +120,72 @@ This project exists thanks to all the people who contribute.
|
||||
|
||||
### Translators
|
||||
|
||||
[Thanks to people helping us to translate Carbon in so many languages](https://carbon.nesbot.com/contribute/translators/)
|
||||
[Thanks to people helping us to translate Carbon in so many languages](https://carbonphp.github.io/carbon/develop/translations/translators.html)
|
||||
|
||||
### Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
|
||||
|
||||
<!-- <open-collective-sponsors> -->
|
||||
<a title="Нова українська букмекерська контора" href="https://betking.com.ua/sports-book/?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/c56d2fe2-f9fb-4d63-947c-77575f4b15c6/stavki.jpg" width="96" height="96"></a>
|
||||
<a title="Онлайн казино 777 Україна" href="https://777.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино 777" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/7e572d50-1ce8-4d69-ae12-86cc80371373/ok-ua-777.png" width="96" height="96"></a>
|
||||
<a title="Non GamStop Bookies UK" href="https://netto.co.uk/betting-sites-not-on-gamstop/?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/51bfaa05-02b3-4cd9-b1a4-9d0d8f34cbae/%D0%97%D0%BD%D1%96%D0%BC%D0%BE%D0%BA%20%D0%B5%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202025-07-04%20%D0%BE%2015.21.16%20(1)%20(1)%20(1).jpg" width="126" height="96"></a>
|
||||
<a title="Best non Gamstop sites in the UK" href="https://www.pieria.co.uk/?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="96" height="96"></a>
|
||||
<a title="Trusted last mile route planning and route optimization" href="https://route4me.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Route4Me Route Planner" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/237386c3-48a2-47c6-97ac-5f888cdb4cda/Route4MeIconLogo.png" width="96" height="96"></a>
|
||||
<a title="Bei Releaf erhalten Sie schnell und diskret Ihr Cannabis Rezept online. Unsere Ärzte prüfen Ihre Angaben und stellen bei Eignung das Rezept aus. Anschließend können Sie legal und sicher medizinisches Cannabis über unsere Partnerapotheken kaufen." href="https://releaf.com/de?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Releaf – Medizinischer Cannabis Shop" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/b686d646-5029-4b4c-8cab-9645ab2679de/9da596d1-f48a-41ec-947d-a64dd8e7529c.png" width="96" height="96"></a>
|
||||
<a title="Buitenlandse Online Casino" href="https://nl.trustpilot.com/review/buitenlandsecasino.vip?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Buitenlandse Online Casino" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/9465308a-8e44-4606-af5d-5a81a3c6567b/ChatGPT%20Image%20Nov%2015%2C%202025%2C%2002_53_25%20PM.png" width="96" height="96"></a>
|
||||
<a title="Online Casino Zonder Registratie" href="https://nl.trustpilot.com/review/zonderregistratiecasinos.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Online Casino Zonder Registratie" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/cf382ddc-627b-4bd9-8870-43ee28d2a628/casino-zonder-registratie.png" width="127.5" height="96"></a>
|
||||
<a title="Mi misión es la educación y transparencia en el mundo de los casinos online" href="https://www.educatransparencia.cl/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Transparencia en Casinos Online" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/c034fdcb-1d17-4c83-8105-f3cfa4f874d6/educalogocito.png" width="192" height="96"></a>
|
||||
<a title="Wildflower" href="https://www.trustpilot.com/review/wildflower.uno?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Wildflower" src="https://images.opencollective.com/wildflower_cases/avatar/256.png" width="96" height="96"></a>
|
||||
<a title="Best non Gamstop sites in the UK" href="https://www.pieria.co.uk/?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="96" height="96"></a>
|
||||
<a title="gaia-wines.gr" href="https://www.gaia-wines.gr/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="gaia-wines.gr" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/a9b971ee-db5f-4400-8c4b-76cf9bc35015/IMAGE%202024-06-14%2013%3A54%3A14.jpg" width="96" height="96"></a>
|
||||
<a title="Ставки на спорт, БК в Україні" href="https://betking.com.ua/sports-book/?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/065e61d2-f890-42db-b06c-8d40b39b2f0e/bk.jpg" width="96" height="96"></a>
|
||||
<a title="non Gamstop casinos" href="https://www.jostrust.org.uk/gambling/casinos-not-on-gamstop/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="non Gamstop casinos" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/49c5bb80-e713-458a-aa10-bc465843ddde/%D0%97%D0%BD%D1%96%D0%BC%D0%BE%D0%BA%20%D0%B5%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202025-08-05%20%D0%BE%2016.10.06%20(2).jpg" width="96" height="96"></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="127.5" height="96"></a>
|
||||
<a title="Real Money Pokies" href="https://onlinecasinoskiwi.co.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/d0f7382e-32ea-4425-a8c4-3019f9ed501c/NZ_logo%20(6)%20(2).jpg" width="96" height="96"></a>
|
||||
<a title="Best Casinos not on Gamstop in the UK 2025" href="https://www.vso.org.uk/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="best non Gamstop casinos" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/3f48874e-f2f6-4062-a2a2-1500677ee3d9/125%D1%85125%20(1).jpg" width="64" height="64"></a>
|
||||
<a title="Онлайн казино та БК (ставки на спорт) в Україні" href="https://betking.com.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Betking казино" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/08587758-582c-4136-aba5-2519230960d3/betking.jpg" width="64" height="64"></a><details><summary>See more</summary>
|
||||
<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="We specialize in the online gambling industry, helping players access reliable and verified information about the best online casinos and pokies in Australia. Our team tests casinos and games, collects user reviews from Trustpilot, and organizes them in o" href="https://au.trustpilot.com/review/bestpayidpokies.net?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="PayID Pokies" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/985a0ae7-54c3-4680-8816-bc8d656f7562/payidpokies.png" width="64" height="64"></a>
|
||||
<a title="TopRating.casino ➢ Гід по онлайн-казино в Україні" href="https://toprating.casino/ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Top Rating casino" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/fec14fc4-85b1-4fdc-971e-e8aabfc60926/toprating%20logo.jpg" width="64" height="64"></a>
|
||||
<a title="iDealeCasinos" href="https://idealecasinos.nl/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="iDealeCasinos" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/907841d3-435e-44b4-9684-c33fd8635ece/ideale-casinos-square-white-logo-300.png" width="64" height="64"></a>
|
||||
<a title="Find the best Interac online casinos in Canada with secure payments, exclusive bonuses, and fast withdrawals." href="https://interac-casino.com/en-ca/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Interac-casino.com - Canada" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/865d9613-74db-45b6-9f33-3ba992682259/2025-09-10%2019.33.08.jpg" width="64" height="64"></a>
|
||||
<a title="Porównanie kasyn online w Polsce. Darmowe automaty online." href="https://onlinekasyno-polis.pl/" target="_blank"><img alt="Online Kasyno Polis" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/12fe53d4-b2e4-4601-b9ea-7b652c414a38/274px%20274px-2.png" width="64" height="64"></a><details><summary>See more</summary>
|
||||
<a title="OnlineCasinosSpelen" href="https://onlinecasinosspelen.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="OnlineCasinosSpelen" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/47e87426-6a55-4f69-9fb5-4e5032dc35a8/5d10dd22-320e-47d4-84e6-d144874f1f5f.png" width="64" height="64"></a>
|
||||
<a title="Betwinner is an online bookmaker offering sports betting, casino games, and more." href="https://guidebook.betwinner.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Guidebook.BetWinner" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/82cab29a-7002-4924-83bf-2eecb03d07c4/0x0.png" width="64" height="64"></a>
|
||||
<a title="Discover the Top 10 Online Casino Australia sites for fast payouts, big bonuses, and top real money pokies" href="https://au.trustpilot.com/review/top-10-online-casino-australia.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Top 10 Casino Australia" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/cd3f2230-ca38-41e1-9f31-f3069b910be3/top-10-online-casino-aus.jpg" width="64" height="64"></a>
|
||||
<a title="We test dozens of casinos every month and select the coolest ones for Australian players." href="https://au.trustpilot.com/review/payid-casino.net?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="PayID Pokies Sites" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/ecd8a5f4-fd86-4903-a512-cbfaff35e7ef/payidpokiessites.png" width="69" height="64"></a>
|
||||
<a title="We collect all reviews about the best online pokies." href="https://au.trustpilot.com/review/aussiepokies.net?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Online Pokies in Australia" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/44d84116-8762-4167-9433-a9e5da542e29/pokies.png" width="64" height="64"></a>
|
||||
<a title="Plinko Game" href="https://www.trustpilot.com/review/plinkoplay.top?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Plinko Game" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/5e953df9-1876-45b6-9ffc-f2009804935b/plinkoo.png" width="64" height="64"></a>
|
||||
<a title="Онлайн казино casino.ua" href="https://casino.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино casino.ua" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/32790ee6-245b-45bd-acf7-7a661fe2cf9f/logo.png" width="64" height="64"></a>
|
||||
<a title="Best PayID Pokies in Australia" href="https://payid-gambler.net/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="PayIDGambler" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/b120ff74-a4cc-4e25-a96f-2b040d60de14/payidgambler.png" width="64" height="64"></a>
|
||||
<a title="Legal-casino.net – незалежний інтернет-портал, присвячений ліцензійним онлайн казино України та азартним іграм в інтернеті. На якому не проводяться ігри на реальні чи віртуальні гроші." href="https://legal-casino.net/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Legal Casino" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/79978436-a1cb-42f1-8269-d495b232934a/legal-casino.jpg" width="64" height="64"></a>
|
||||
<a title="Playfortune.net.br" href="https://playfortune.net.br/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Playfortune.net.br" src="https://logo.clearbit.com/playfortune.net.br" width="64" height="64"></a>
|
||||
<a title="https://play-fortune.pl/kasyno/z-minimalnym-depozytem/" href="https://play-fortune.pl/kasyno/z-minimalnym-depozytem/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="https://play-fortune.pl/kasyno/z-minimalnym-depozytem/" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/cbeea308-5148-4f6c-ac6e-dbfa029aadd1/PL.png" width="64" height="64"></a>
|
||||
<a title="Best-betting.net is an Indian website where you can always find interesting, useful, and up-to-date information about cricket and other sports. Additionally, on our portal, you can explore predictions and betting opportunities for the most exciting sports" href="https://best-betting.net/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Best Betting" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/4b437e94-747c-4cf5-be67-d11bf8472d76/bestbetting-logo-cover.png" width="64" height="64"></a>
|
||||
<a title="WestNews – проект Александра Победы о гемблинге и онлайн-казино в Украине, предлагающий новости, обзоры, рейтинги и гиды по игорным заведениям." href="https://westnews.com.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="WestNews онлайн казино Украины" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/7fae83dd-0d53-42f7-b63c-d7062a86ccb1/3502ab17-a150-40e1-8f01-c26ff60c4cf8.png" width="64" height="64"></a>
|
||||
<a title="Porównanie kasyn online w Polsce. Darmowe automaty online." href="https://onlinekasyno-polis.pl/" target="_blank"><img alt="Online Kasyno Polis" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/12fe53d4-b2e4-4601-b9ea-7b652c414a38/274px%20274px-2.png" width="64" height="64"></a>
|
||||
<a title="Offshore bookmakers review site." href="https://www.sportsbookreviewsonline.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Sportsbook Reviews Online" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/6d499f24-d669-4fc6-bb5f-b87184aa7963/sportsbookreviewsonline_com.png" width="64" height="64"></a>
|
||||
<a title="Ставки на спорт Favbet" href="https://www.favbet.ua/uk/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Ставки на спорт Favbet" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/d86d313e-7b17-42fa-8b76-3f17fbf681a2/favbet-logo.jpg" width="64" height="64"></a>
|
||||
<a title="UK casinos not on GamStop" href="https://www.stjames-theatre.co.uk/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="UK casinos not on GamStop" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/34e5e82e-2121-4082-a321-050dca381d6c/%D0%97%D0%BD%D1%96%D0%BC%D0%BE%D0%BA%20%D0%B5%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202025-01-10%20%D0%BE%2015.29.42%20(1)%20(1).jpg" width="42" height="42"></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="42" height="42"></a>
|
||||
<a title="Real Money Pokies" href="https://onlinecasinoskiwi.co.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/d0f7382e-32ea-4425-a8c4-3019f9ed501c/NZ_logo%20(6)%20(2).jpg" width="64" height="64"></a>
|
||||
<a title="Uudet Nettikasinot" href="https://fi.parhaatuudetkasinot.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="parhaatuudetkasinot.com" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/09e109d6-8ad2-4ade-ab24-4427028c8e38/260bfa9d-6a5c-494d-9ec0-a624327429ae.png" width="64" height="64"></a>
|
||||
<a title="matej_j" href="https://matej.jurancic.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="matej_j" src="https://www.gravatar.com/avatar/a145a33757bfa7be46eb0b449485f13c?default=404" width="64" height="64"></a>
|
||||
<a title="New Casino Bonuses" href="https://newcasinobonuses.gb.net/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="New Casino Bonuses" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/38e356d8-3597-406a-a263-1c348723aa17/new_casino_bonuses_logo.png" width="64" height="64"></a>
|
||||
<a title="Best online sports betting and casino company." href="https://global.fun88.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Fun88" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/1688ebca-4984-4b9b-a24d-8fdd1233892f/fun88-logo.png" width="64" height="64"></a>
|
||||
<a title="Top 50 Online Casinos UK" href="https://eastvillafc.co.uk?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="East Villa FC" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/2560f1b5-20d6-4cf4-83cd-2457bf111fc3/trophy-fav-blue.png" width="64" height="64"></a>
|
||||
<a title="Instant withdrawal casino" href="https://au.trustpilot.com/review/quickcashoutcasinos.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Instant withdrawal casino" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/e4be26b6-a57a-4758-ad56-bd31c759465e/quickcashoutcasinos2.png" width="75" height="64"></a>
|
||||
<a title="บริษัทรับแทงบอลออนไลน์ที่ดีที่สุดในประเทศไทย" href="https://www.fun88thh.com/th/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Fun88" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/bbf7174c-fc01-4ce6-86b5-f621e350969d/fun88-logo.png" width="64" height="64"></a>
|
||||
<a title="Nhà cái cá cược thể thao trực tuyến tốt nhất tại Việt Nam" href="https://www.fun88vnu.com/vn/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Fun88" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/ed704e1d-3894-48bb-83e3-6094b2c68a5c/fun88-logo.png" width="64" height="64"></a>
|
||||
<a title="Casino ohne oasis" href="https://de.trustpilot.com/review/onlinecasinoohneoasis.me?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Casino ohne oasis" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/f59e1e3a-6378-4aa7-91f5-6934a58bc21d/oasis.png" width="64" height="64"></a>
|
||||
<a title="Najlepsi Bukmacherzy" href="https://najlepsibukmacherzy.pl/ranking-legalnych-bukmacherow/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Najlepsi Bukmacherzy" src="https://opencollective-production.s3.us-west-1.amazonaws.com/81588eb0-608a-11eb-ad1c-b119533ac7bb.png" width="64" height="64"></a>
|
||||
<a title="Paysafecard Casino" href="https://de.trustpilot.com/review/onlinecasinospaysafecard.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Paysafecard Casino" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/641d34bb-f65f-4df5-a6ec-ad5ab35df1e0/paysafe.png" width="64" height="64"></a>
|
||||
<a title="Offshore bookmakers review site." href="https://www.sportsbookreviewsonline.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Sportsbook Reviews Online" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/6d499f24-d669-4fc6-bb5f-b87184aa7963/sportsbookreviewsonline_com.png" width="42" height="42"></a>
|
||||
<a title="Get professional support for Carbon" href="https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=docs" target="_blank"><img alt="Tidelift" src="https://carbonphp.github.io/carbon/sponsors/tidelift-brand.png" width="84" height="42"></a>
|
||||
<a title="Ставки на спорт Favbet" href="https://www.favbet.ua/uk/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Ставки на спорт Favbet" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/d86d313e-7b17-42fa-8b76-3f17fbf681a2/favbet-logo.jpg" width="42" height="42"></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://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/870b4bd0-b6aa-4129-9827-e8ac02cfde56/167bdc1d-0a19-414d-a288-cfc3278b388f.png" width="42" height="42"></a>
|
||||
<a title="Best Casinos not on Gamstop in the UK 2025" href="https://www.vso.org.uk/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="best non Gamstop casinos" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/3f48874e-f2f6-4062-a2a2-1500677ee3d9/125%D1%85125%20(1).jpg" width="42" height="42"></a>
|
||||
<a title="https://play-fortune.pl/kasyno/z-minimalnym-depozytem/" href="https://play-fortune.pl/kasyno/z-minimalnym-depozytem/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="https://play-fortune.pl/kasyno/z-minimalnym-depozytem/" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/cbeea308-5148-4f6c-ac6e-dbfa029aadd1/PL.png" width="42" height="42"></a>
|
||||
<a title="Playfortune.net.br" href="https://playfortune.net.br/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Playfortune.net.br" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/bf7ba31d-648c-470f-bf7e-2293c5ca0509/62a0353e-3858-41f1-bbb3-597449949e66.png" width="42" height="42"></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="58" height="42"></a>
|
||||
<a title="Get professional support for Carbon" href="https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=docs" target="_blank"><img alt="Tidelift" src="https://carbon.nesbot.com/docs/sponsors/tidelift-brand.png" width="84" height="42"></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="42" height="42"></a>
|
||||
<a title="Slots not on GamStop" href="https://nogamstopcasinos.uk/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Slots not on GamStop" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/3b5fedc2-f3e5-41f5-84a9-869e2cbeb632/%D0%97%D0%BD%D1%96%D0%BC%D0%BE%D0%BA%20%D0%B5%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202025-05-01%20%D0%BE%2019.38.02%20(1)%20(1)%20(1).jpg" width="42" height="42"></a>
|
||||
<a title="Онлайн казино та БК (ставки на спорт) в Україні" href="https://betking.com.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="betking онлайн казино" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/08587758-582c-4136-aba5-2519230960d3/betking.jpg" width="42" height="42"></a>
|
||||
<a title="BetPokies NZ features top fast payout casinos where winnings are processed within hours. The speed depends on the casino and payment method, with the platform highlighting the best options for smooth, reliable play." href="https://betpokies.co.nz/casinos/fast-payout?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Fastest Payout Online Casino" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/37cba042-a941-4bfd-87c4-b4f4c1a98641/7912b3ee-3c62-4ebd-b435-6a9a88b2228b.png" width="42" height="42"></a>
|
||||
<a title="inkedin" href="https://inkedin.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="inkedin" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/6cb31863-b725-49c5-820c-2c2be7d54adf/cc930e12-04de-4574-9cca-171e07d277c3.png" width="42" height="42"></a>
|
||||
<a title="Best PayID Pokies in Australia" href="https://ausgambler.net/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="AusGambler" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/b120ff74-a4cc-4e25-a96f-2b040d60de14/payidgambler.png" width="42" height="42"></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="42" height="42"></a>
|
||||
<a title="Post-production resource scheduling app" href="https://freispace.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="freispace" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/7d553b00-78ff-4442-91dd-33c220e82ac4/freispace-icon-inverted.png" width="42" height="42"></a>
|
||||
<a title="bestecasinozondercruks" href="https://nl.trustpilot.com/review/bestecasinozondercruks.online?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="bestecasinozondercruks" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/4948eca9-abd5-49ea-bb70-1ea6053f8663/ChatGPT%20Image%20Dec%2027%2C%202025%2C%2010_22_47%20PM-min.png" width="42" height="42"></a>
|
||||
<a title="Run Weekly" href="https://www.runweekly.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Run Weekly" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/4d7e1fad-f160-4b64-ab41-d493023f9369/2de8e56c-e9fa-497c-8882-3736ec946664.png" width="42" height="42"></a>
|
||||
<a title="Are you looking for the latest online casino sites to play in the UK? How about ones that actually deliver on their promises? Every year new online casinos pops up, but are they worth your time? Check out https://helpdirect.org.uk" href="https://helpdirect.org.uk/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="New Casino Sites UK (2025) Help Direct" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/d5e8c98f-7df3-40e8-bfe1-3c1583222eab/help-direct-logo-white-trans.png" width="42" height="42"></a>
|
||||
<a title="UnAIMyText" href="https://unaimytext.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="UnAIMyText" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/fa5b36d5-69e6-44a4-bbdf-b5d264399365/icon_resized.png" width="42" height="42"></a>
|
||||
<a title="Online Casino utan Svensk licens" href="https://se.trustpilot.com/review/casino-utan-svensk-licens-se.se?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Online Casino utan Svensk licens" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/64a7a6b0-e843-4cc2-a04e-0e829ccade58/logose.png" width="42" height="42"></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="59" height="42"></a>
|
||||
<a title="Sites not on GamStop" href="https://casinonotongamstop.uk/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Sites not on GamStop" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/5c5977b8-1e94-43d6-b2d7-4af25bb85dbd/%D0%97%D0%BD%D1%96%D0%BC%D0%BE%D0%BA%20%D0%B5%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202025-05-01%20%D0%BE%2015.08.38%20(1)%20(2).jpg" width="68" height="42"></a>
|
||||
<a title="Проект с обзорами легальных онлайн казино Украины. Мы помогаем выбрать лучше казино онлайн игрокам." href="https://sportarena.com/casino/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Лучшие онлайн казино Украины на Sportarena" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/765475f7-3fea-4867-8f83-7b6f91b06128/sportarena%20(1).png" width="40" height="42"></a>
|
||||
<a title="Проєкт з оглядами онлайн казино та їхніх бонусів. На сайті можна знайти актуальні промокоди та інші бонуси онлайн казино України." href="https://y-k.com.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино та їхні бонуси y-k.com.ua" src="https://logo.clearbit.com/y-k.com.ua" width="42" height="42"></a>
|
||||
<a title="Casinos not on Gamstop" href="https://lgcnews.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Non Gamstop Casinos" src="https://lgcnews.com/wp-content/uploads/2018/01/LGC-logo-v8-temp.png" width="84" height="42"></a>
|
||||
<a title="Slotozilla website" href="https://www.slotozilla.com/nz/free-spins" target="_blank"><img alt="Slotozilla" src="https://carbon.nesbot.com/docs/sponsors/slotozilla.png" width="42" height="42"></a>
|
||||
<a title="ігрові автомати беткінг" href="https://betking.com.ua/games/all-slots/?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="42" height="42"></a>
|
||||
<a title="ssddanbrown" href="https://github.com/ssddanbrown" target="_blank"><img alt="ssddanbrown" src="https://avatars.githubusercontent.com/u/8343178?s=128&v=4" width="42" height="42"></a></details><!-- </open-collective-sponsors> -->
|
||||
|
||||
[[See all](https://carbon.nesbot.com/#sponsors)]
|
||||
[[See all](https://carbonphp.github.io/carbon/#sponsors)]
|
||||
|
||||
[[Become a sponsor via OpenCollective*](https://opencollective.com/Carbon#sponsor)]
|
||||
|
||||
|
||||
268
plugins/vendor/nesbot/carbon/sponsors.php
vendored
268
plugins/vendor/nesbot/carbon/sponsors.php
vendored
@@ -1,268 +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.
|
||||
*/
|
||||
|
||||
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 getHtmlAttribute($rawValue): string
|
||||
{
|
||||
return str_replace(
|
||||
['', "\r"],
|
||||
'',
|
||||
trim(htmlspecialchars((string) $rawValue), " \n\r\t\v\0"),
|
||||
);
|
||||
}
|
||||
|
||||
function getOpenCollectiveSponsors(): string
|
||||
{
|
||||
$customSponsorOverride = [
|
||||
// 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
|
||||
662698 => [
|
||||
// alt attribute
|
||||
'name' => 'Non Gamstop Casinos',
|
||||
// title attribute
|
||||
'description' => 'Casinos not on Gamstop',
|
||||
// src attribute
|
||||
'image' => 'https://lgcnews.com/wp-content/uploads/2018/01/LGC-logo-v8-temp.png',
|
||||
// href attribute
|
||||
'website' => 'https://lgcnews.com/',
|
||||
],
|
||||
663069 => [
|
||||
// alt attribute
|
||||
'name' => 'Ставки на спорт Favbet',
|
||||
// href attribute
|
||||
'website' => 'https://www.favbet.ua/uk/',
|
||||
],
|
||||
676798 => [
|
||||
// alt attribute
|
||||
'name' => 'Top Casinos Canada',
|
||||
// title attribute
|
||||
'description' => 'Top Casinos Canada',
|
||||
// src attribute
|
||||
'image' => 'https://topcasino.net/img/topcasino-logo-cover.png',
|
||||
// href attribute
|
||||
'website' => 'https://topcasino.net/',
|
||||
],
|
||||
];
|
||||
|
||||
$members = json_decode(file_get_contents('https://opencollective.com/carbon/members/all.json'), true);
|
||||
|
||||
foreach ($members as &$member) {
|
||||
$member = array_merge($member, $customSponsorOverride[$member['MemberId']] ?? []);
|
||||
}
|
||||
|
||||
// Adding sponsors paying via other payment methods
|
||||
$members[] = [
|
||||
'MemberId' => 1,
|
||||
'createdAt' => '2019-01-01 02:00',
|
||||
'type' => 'ORGANIZATION',
|
||||
'role' => 'BACKER',
|
||||
'tier' => 'backer+',
|
||||
'isActive' => true,
|
||||
'totalAmountDonated' => 1000,
|
||||
'currency' => 'USD',
|
||||
'lastTransactionAt' => CarbonImmutable::now()->format('Y-m-d').' 02:00',
|
||||
'lastTransactionAmount' => 25,
|
||||
'profile' => 'https://tidelift.com/',
|
||||
'name' => 'Tidelift',
|
||||
'description' => 'Get professional support for Carbon',
|
||||
'image' => 'https://carbon.nesbot.com/docs/sponsors/tidelift-brand.png',
|
||||
'website' => 'https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=docs',
|
||||
];
|
||||
$members[] = [
|
||||
'MemberId' => 2,
|
||||
'createdAt' => '2024-11-14 02:00',
|
||||
'type' => 'ORGANIZATION',
|
||||
'role' => 'BACKER',
|
||||
'tier' => 'backer+ yearly',
|
||||
'isActive' => true,
|
||||
'totalAmountDonated' => 170,
|
||||
'currency' => 'USD',
|
||||
'lastTransactionAt' => '2024-11-14 02:00',
|
||||
'lastTransactionAmount' => 170,
|
||||
'profile' => 'https://www.slotozilla.com/nz/free-spins',
|
||||
'name' => 'Slotozilla',
|
||||
'description' => 'Slotozilla website',
|
||||
'image' => 'https://carbon.nesbot.com/docs/sponsors/slotozilla.png',
|
||||
'website' => 'https://www.slotozilla.com/nz/free-spins',
|
||||
];
|
||||
|
||||
$list = array_filter($members, static fn (array $member): bool => $member['totalAmountDonated'] > 3 && $member['role'] !== 'HOST' && (
|
||||
$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'));
|
||||
}
|
||||
|
||||
$isYearly = str_contains(strtolower($member['tier'] ?? ''), 'yearly');
|
||||
$monthlyContribution = (float) (
|
||||
($isYearly && $lastTransactionAt > CarbonImmutable::parse('-1 year'))
|
||||
? ($member['lastTransactionAmount'] / 11.2) // 11.2 instead of 12 to include the discount for yearly subscription
|
||||
: ($member['totalAmountDonated'] / ceil($createdAt->floatDiffInMonths()))
|
||||
);
|
||||
|
||||
if (!$isYearly) {
|
||||
if (
|
||||
$lastTransactionAt->isAfter('last month') &&
|
||||
$member['lastTransactionAmount'] > $monthlyContribution
|
||||
) {
|
||||
$monthlyContribution = (float) $member['lastTransactionAmount'];
|
||||
}
|
||||
|
||||
if ($lastTransactionAt->isBefore('-75 days')) {
|
||||
$days = min(120, $lastTransactionAt->diffInDays('now') - 70);
|
||||
$monthlyContribution *= 1 - $days / 240;
|
||||
}
|
||||
}
|
||||
|
||||
$yearlyContribution = (float) (
|
||||
$isYearly
|
||||
? (12 * $monthlyContribution)
|
||||
: ($member['totalAmountDonated'] / max(1, $createdAt->floatDiffInYears()))
|
||||
);
|
||||
$status = null;
|
||||
$rank = 0;
|
||||
|
||||
if ($monthlyContribution > 50 || $yearlyContribution > 900) {
|
||||
$status = 'sponsor';
|
||||
$rank = 5;
|
||||
} elseif ($monthlyContribution > 29 || $yearlyContribution > 700) {
|
||||
$status = 'sponsor';
|
||||
$rank = 4;
|
||||
} elseif ($monthlyContribution > 14.5 || $yearlyContribution > 500) {
|
||||
$status = 'backerPlus';
|
||||
$rank = 3;
|
||||
} elseif ($monthlyContribution > 4.5 || $yearlyContribution > 80) {
|
||||
$status = 'backer';
|
||||
$rank = 2;
|
||||
} elseif ($member['totalAmountDonated'] > 0) {
|
||||
$status = 'helper';
|
||||
$rank = 1;
|
||||
}
|
||||
|
||||
return array_merge($member, [
|
||||
'star' => ($monthlyContribution > 98 || $yearlyContribution > 800),
|
||||
'status' => $status,
|
||||
'rank' => $rank,
|
||||
'monthlyContribution' => $monthlyContribution,
|
||||
'yearlyContribution' => $yearlyContribution,
|
||||
]);
|
||||
}, $list);
|
||||
|
||||
usort($list, static function (array $a, array $b): int {
|
||||
return ($b['star'] <=> $a['star'])
|
||||
?: ($b['rank'] <=> $a['rank'])
|
||||
?: ($b['monthlyContribution'] <=> $a['monthlyContribution'])
|
||||
?: ($b['totalAmountDonated'] <=> $a['totalAmountDonated']);
|
||||
});
|
||||
|
||||
$membersByUrl = [];
|
||||
$output = '';
|
||||
$extra = '';
|
||||
|
||||
foreach ($list as $member) {
|
||||
$url = $member['website'] ?? $member['profile'];
|
||||
|
||||
if (isset($membersByUrl[$url]) || !\in_array($member['status'], ['sponsor', 'backerPlus'], true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$membersByUrl[$url] = $member;
|
||||
$href = htmlspecialchars($url);
|
||||
$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 = match ($member['status']) {
|
||||
'sponsor' => 64,
|
||||
'backerPlus' => 42,
|
||||
'backer' => 32,
|
||||
default => 24,
|
||||
};
|
||||
$rel = match ($member['status']) {
|
||||
'sponsor', 'backerPlus' => '',
|
||||
default => ' rel="sponsored"',
|
||||
};
|
||||
|
||||
$width = min($height * 2, $validImage ? round($x * $height / $y) : $height);
|
||||
|
||||
if (!str_contains($href, 'utm_source') && !preg_match('/^https?:\/\/(?:www\.)?(?:onlinekasyno-polis\.pl|zonaminecraft\.net|slotozilla\.com)(\/.*)?/', $href)) {
|
||||
$href .= (!str_contains($href, '?') ? '?' : '&').'utm_source=opencollective&utm_medium=github&utm_campaign=Carbon';
|
||||
}
|
||||
|
||||
$title = getHtmlAttribute(($member['description'] ?? null) ?: $member['name']);
|
||||
$alt = getHtmlAttribute($member['name']);
|
||||
|
||||
if ($member['star']) {
|
||||
$width *= 1.5;
|
||||
$height *= 1.5;
|
||||
}
|
||||
|
||||
$link = "\n".'<a title="'.$title.'" href="'.$href.'" target="_blank"'.$rel.'>'.
|
||||
'<img alt="'.$alt.'" src="'.$src.'" width="'.$width.'" height="'.$height.'">'.
|
||||
'</a>';
|
||||
|
||||
if ($member['rank'] >= 5) {
|
||||
$output .= $link;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$extra .= $link;
|
||||
}
|
||||
|
||||
$github = [
|
||||
8343178 => 'ssddanbrown',
|
||||
];
|
||||
|
||||
foreach ($github as $avatar => $user) {
|
||||
$extra .= "\n".'<a title="'.$user.'" href="https://github.com/'.$user.'" target="_blank">'.
|
||||
'<img alt="'.$user.'" src="https://avatars.githubusercontent.com/u/'.$avatar.'?s=128&v=4" width="42" height="42">'.
|
||||
'</a>';
|
||||
}
|
||||
|
||||
return $output.'<details><summary>See more</summary>'.$extra.'</details>';
|
||||
}
|
||||
|
||||
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'),
|
||||
));
|
||||
@@ -202,9 +202,7 @@ abstract class AbstractTranslator extends SymfonyTranslator
|
||||
$files = [];
|
||||
|
||||
foreach ($this->getDirectories() as $directory) {
|
||||
$directory = rtrim($directory, '\\/');
|
||||
|
||||
foreach (glob("$directory/$prefix*.php") as $file) {
|
||||
foreach (self::getPhpFilesInDirectory(rtrim($directory, '\\/'), $prefix) as $file) {
|
||||
$files[] = $file;
|
||||
}
|
||||
}
|
||||
@@ -222,20 +220,18 @@ abstract class AbstractTranslator extends SymfonyTranslator
|
||||
*/
|
||||
public function getAvailableLocales(string $prefix = ''): array
|
||||
{
|
||||
$locales = [];
|
||||
foreach ($this->getLocalesFiles($prefix) as $file) {
|
||||
$locales[] = substr($file, strrpos($file, '/') + 1, -4);
|
||||
}
|
||||
|
||||
return array_unique(array_merge($locales, array_keys($this->messages)));
|
||||
return array_unique(array_merge(
|
||||
array_map(
|
||||
static fn (string $file) => substr($file, strrpos($file, '/') + 1, -4),
|
||||
$this->getLocalesFiles($prefix),
|
||||
),
|
||||
array_keys($this->messages),
|
||||
));
|
||||
}
|
||||
|
||||
protected function translate(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string
|
||||
{
|
||||
if ($domain === null) {
|
||||
$domain = 'messages';
|
||||
}
|
||||
|
||||
$domain ??= 'messages';
|
||||
$catalogue = $this->getCatalogue($locale);
|
||||
$format = $this instanceof TranslatorStrongTypeInterface
|
||||
? $this->getFromCatalogue($catalogue, (string) $id, $domain)
|
||||
@@ -352,16 +348,20 @@ abstract class AbstractTranslator extends SymfonyTranslator
|
||||
|
||||
usort($locales, static fn ($first, $second) => $getScore($second) <=> $getScore($first));
|
||||
|
||||
$locale = $locales[0];
|
||||
$locale = $locales[0] ?? 'en';
|
||||
}
|
||||
|
||||
if (isset($this->aliases[$locale])) {
|
||||
$locale = $this->aliases[$locale];
|
||||
}
|
||||
|
||||
// If subtag (ex: en_CA) first load the macro (ex: en) to have a fallback
|
||||
if (str_contains($locale, '_') &&
|
||||
$this->loadMessagesFromFile($macroLocale = preg_replace('/^([^_]+).*$/', '$1', $locale))
|
||||
// If the language is not provided by a Carbon file
|
||||
// and the tag contains a region (ex: en_CA), then
|
||||
// first load the macro (ex: en) to have a fallback
|
||||
if (
|
||||
str_contains($locale, '_')
|
||||
&& !\in_array($locale, self::getInternallySupportedLocales(), true)
|
||||
&& $this->loadMessagesFromFile($macroLocale = preg_replace('/^([^_]+).*$/', '$1', $locale))
|
||||
) {
|
||||
parent::setLocale($macroLocale);
|
||||
}
|
||||
@@ -401,7 +401,7 @@ abstract class AbstractTranslator extends SymfonyTranslator
|
||||
{
|
||||
parent::setLocale($locale);
|
||||
$this->initializing = true;
|
||||
$this->directories = [__DIR__.'/Lang'];
|
||||
$this->directories = [self::getDefaultLangDirectory()];
|
||||
$this->addLoader('array', new ArrayLoader());
|
||||
parent::__construct($locale, new MessageFormatterMapper($formatter), $cacheDir, $debug);
|
||||
$this->initializing = false;
|
||||
@@ -437,4 +437,863 @@ abstract class AbstractTranslator extends SymfonyTranslator
|
||||
// Clear resources if available, if not, then nothing to clean
|
||||
}
|
||||
}
|
||||
|
||||
private static function getPhpFilesInDirectory(string $directory, string $prefix): array
|
||||
{
|
||||
if ($directory !== self::getDefaultLangDirectory()) {
|
||||
return glob("$directory/$prefix*.php") ?: [];
|
||||
}
|
||||
|
||||
// If it's the internal Carbon directory we use a static list
|
||||
// which is faster than scanning the folder with glob()
|
||||
$locales = self::getInternallySupportedLocales();
|
||||
|
||||
if ($prefix !== '') {
|
||||
$locales = array_values(array_filter(
|
||||
self::getInternallySupportedLocales(),
|
||||
static fn (string $locale) => str_starts_with($locale, $prefix),
|
||||
));
|
||||
}
|
||||
|
||||
return array_map(
|
||||
static fn (string $locale) => "$directory/$locale.php",
|
||||
$locales,
|
||||
);
|
||||
}
|
||||
|
||||
private static function getDefaultLangDirectory(): string
|
||||
{
|
||||
return __DIR__.'/Lang';
|
||||
}
|
||||
|
||||
/** @return list<string> */
|
||||
private static function getInternallySupportedLocales(): array
|
||||
{
|
||||
return [
|
||||
'aa',
|
||||
'aa_DJ',
|
||||
'aa_ER',
|
||||
'aa_ER@saaho',
|
||||
'aa_ET',
|
||||
'af',
|
||||
'af_NA',
|
||||
'af_ZA',
|
||||
'agq',
|
||||
'agr',
|
||||
'agr_PE',
|
||||
'ak',
|
||||
'ak_GH',
|
||||
'am',
|
||||
'am_ET',
|
||||
'an',
|
||||
'an_ES',
|
||||
'anp',
|
||||
'anp_IN',
|
||||
'ar',
|
||||
'ar_AE',
|
||||
'ar_BH',
|
||||
'ar_DJ',
|
||||
'ar_DZ',
|
||||
'ar_EG',
|
||||
'ar_EH',
|
||||
'ar_ER',
|
||||
'ar_IL',
|
||||
'ar_IN',
|
||||
'ar_IQ',
|
||||
'ar_JO',
|
||||
'ar_KM',
|
||||
'ar_KW',
|
||||
'ar_LB',
|
||||
'ar_LY',
|
||||
'ar_MA',
|
||||
'ar_MR',
|
||||
'ar_OM',
|
||||
'ar_PS',
|
||||
'ar_QA',
|
||||
'ar_SA',
|
||||
'ar_SD',
|
||||
'ar_SO',
|
||||
'ar_SS',
|
||||
'ar_SY',
|
||||
'ar_Shakl',
|
||||
'ar_TD',
|
||||
'ar_TN',
|
||||
'ar_YE',
|
||||
'as',
|
||||
'as_IN',
|
||||
'asa',
|
||||
'ast',
|
||||
'ast_ES',
|
||||
'ayc',
|
||||
'ayc_PE',
|
||||
'az',
|
||||
'az_AZ',
|
||||
'az_Arab',
|
||||
'az_Cyrl',
|
||||
'az_IR',
|
||||
'az_Latn',
|
||||
'bas',
|
||||
'be',
|
||||
'be_BY',
|
||||
'be_BY@latin',
|
||||
'bem',
|
||||
'bem_ZM',
|
||||
'ber',
|
||||
'ber_DZ',
|
||||
'ber_MA',
|
||||
'bez',
|
||||
'bg',
|
||||
'bg_BG',
|
||||
'bhb',
|
||||
'bhb_IN',
|
||||
'bho',
|
||||
'bho_IN',
|
||||
'bi',
|
||||
'bi_VU',
|
||||
'bm',
|
||||
'bn',
|
||||
'bn_BD',
|
||||
'bn_IN',
|
||||
'bo',
|
||||
'bo_CN',
|
||||
'bo_IN',
|
||||
'br',
|
||||
'br_FR',
|
||||
'brx',
|
||||
'brx_IN',
|
||||
'bs',
|
||||
'bs_BA',
|
||||
'bs_Cyrl',
|
||||
'bs_Latn',
|
||||
'byn',
|
||||
'byn_ER',
|
||||
'ca',
|
||||
'ca_AD',
|
||||
'ca_ES',
|
||||
'ca_ES_Valencia',
|
||||
'ca_FR',
|
||||
'ca_IT',
|
||||
'ccp',
|
||||
'ccp_IN',
|
||||
'ce',
|
||||
'ce_RU',
|
||||
'cgg',
|
||||
'chr',
|
||||
'chr_US',
|
||||
'ckb',
|
||||
'cmn',
|
||||
'cmn_TW',
|
||||
'crh',
|
||||
'crh_UA',
|
||||
'cs',
|
||||
'cs_CZ',
|
||||
'csb',
|
||||
'csb_PL',
|
||||
'cu',
|
||||
'cv',
|
||||
'cv_RU',
|
||||
'cy',
|
||||
'cy_GB',
|
||||
'da',
|
||||
'da_DK',
|
||||
'da_GL',
|
||||
'dav',
|
||||
'de',
|
||||
'de_AT',
|
||||
'de_BE',
|
||||
'de_CH',
|
||||
'de_DE',
|
||||
'de_IT',
|
||||
'de_LI',
|
||||
'de_LU',
|
||||
'dje',
|
||||
'doi',
|
||||
'doi_IN',
|
||||
'dsb',
|
||||
'dsb_DE',
|
||||
'dua',
|
||||
'dv',
|
||||
'dv_MV',
|
||||
'dyo',
|
||||
'dz',
|
||||
'dz_BT',
|
||||
'ebu',
|
||||
'ee',
|
||||
'ee_TG',
|
||||
'el',
|
||||
'el_CY',
|
||||
'el_GR',
|
||||
'en',
|
||||
'en_001',
|
||||
'en_150',
|
||||
'en_AG',
|
||||
'en_AI',
|
||||
'en_AS',
|
||||
'en_AT',
|
||||
'en_AU',
|
||||
'en_BB',
|
||||
'en_BE',
|
||||
'en_BI',
|
||||
'en_BM',
|
||||
'en_BS',
|
||||
'en_BW',
|
||||
'en_BZ',
|
||||
'en_CA',
|
||||
'en_CC',
|
||||
'en_CH',
|
||||
'en_CK',
|
||||
'en_CM',
|
||||
'en_CX',
|
||||
'en_CY',
|
||||
'en_DE',
|
||||
'en_DG',
|
||||
'en_DK',
|
||||
'en_DM',
|
||||
'en_ER',
|
||||
'en_FI',
|
||||
'en_FJ',
|
||||
'en_FK',
|
||||
'en_FM',
|
||||
'en_GB',
|
||||
'en_GD',
|
||||
'en_GG',
|
||||
'en_GH',
|
||||
'en_GI',
|
||||
'en_GM',
|
||||
'en_GU',
|
||||
'en_GY',
|
||||
'en_HK',
|
||||
'en_IE',
|
||||
'en_IL',
|
||||
'en_IM',
|
||||
'en_IN',
|
||||
'en_IO',
|
||||
'en_ISO',
|
||||
'en_JE',
|
||||
'en_JM',
|
||||
'en_KE',
|
||||
'en_KI',
|
||||
'en_KN',
|
||||
'en_KY',
|
||||
'en_LC',
|
||||
'en_LR',
|
||||
'en_LS',
|
||||
'en_MG',
|
||||
'en_MH',
|
||||
'en_MO',
|
||||
'en_MP',
|
||||
'en_MS',
|
||||
'en_MT',
|
||||
'en_MU',
|
||||
'en_MW',
|
||||
'en_MY',
|
||||
'en_NA',
|
||||
'en_NF',
|
||||
'en_NG',
|
||||
'en_NL',
|
||||
'en_NR',
|
||||
'en_NU',
|
||||
'en_NZ',
|
||||
'en_PG',
|
||||
'en_PH',
|
||||
'en_PK',
|
||||
'en_PN',
|
||||
'en_PR',
|
||||
'en_PW',
|
||||
'en_RW',
|
||||
'en_SB',
|
||||
'en_SC',
|
||||
'en_SD',
|
||||
'en_SE',
|
||||
'en_SG',
|
||||
'en_SH',
|
||||
'en_SI',
|
||||
'en_SL',
|
||||
'en_SS',
|
||||
'en_SX',
|
||||
'en_SZ',
|
||||
'en_TC',
|
||||
'en_TK',
|
||||
'en_TO',
|
||||
'en_TT',
|
||||
'en_TV',
|
||||
'en_TZ',
|
||||
'en_UG',
|
||||
'en_UM',
|
||||
'en_US',
|
||||
'en_US_Posix',
|
||||
'en_VC',
|
||||
'en_VG',
|
||||
'en_VI',
|
||||
'en_VU',
|
||||
'en_WS',
|
||||
'en_ZA',
|
||||
'en_ZM',
|
||||
'en_ZW',
|
||||
'eo',
|
||||
'es',
|
||||
'es_419',
|
||||
'es_AR',
|
||||
'es_BO',
|
||||
'es_BR',
|
||||
'es_BZ',
|
||||
'es_CL',
|
||||
'es_CO',
|
||||
'es_CR',
|
||||
'es_CU',
|
||||
'es_DO',
|
||||
'es_EA',
|
||||
'es_EC',
|
||||
'es_ES',
|
||||
'es_GQ',
|
||||
'es_GT',
|
||||
'es_HN',
|
||||
'es_IC',
|
||||
'es_MX',
|
||||
'es_NI',
|
||||
'es_PA',
|
||||
'es_PE',
|
||||
'es_PH',
|
||||
'es_PR',
|
||||
'es_PY',
|
||||
'es_SV',
|
||||
'es_US',
|
||||
'es_UY',
|
||||
'es_VE',
|
||||
'et',
|
||||
'et_EE',
|
||||
'eu',
|
||||
'eu_ES',
|
||||
'ewo',
|
||||
'fa',
|
||||
'fa_AF',
|
||||
'fa_IR',
|
||||
'ff',
|
||||
'ff_CM',
|
||||
'ff_GN',
|
||||
'ff_MR',
|
||||
'ff_SN',
|
||||
'fi',
|
||||
'fi_FI',
|
||||
'fil',
|
||||
'fil_PH',
|
||||
'fo',
|
||||
'fo_DK',
|
||||
'fo_FO',
|
||||
'fr',
|
||||
'fr_BE',
|
||||
'fr_BF',
|
||||
'fr_BI',
|
||||
'fr_BJ',
|
||||
'fr_BL',
|
||||
'fr_CA',
|
||||
'fr_CD',
|
||||
'fr_CF',
|
||||
'fr_CG',
|
||||
'fr_CH',
|
||||
'fr_CI',
|
||||
'fr_CM',
|
||||
'fr_DJ',
|
||||
'fr_DZ',
|
||||
'fr_FR',
|
||||
'fr_GA',
|
||||
'fr_GF',
|
||||
'fr_GN',
|
||||
'fr_GP',
|
||||
'fr_GQ',
|
||||
'fr_HT',
|
||||
'fr_KM',
|
||||
'fr_LU',
|
||||
'fr_MA',
|
||||
'fr_MC',
|
||||
'fr_MF',
|
||||
'fr_MG',
|
||||
'fr_ML',
|
||||
'fr_MQ',
|
||||
'fr_MR',
|
||||
'fr_MU',
|
||||
'fr_NC',
|
||||
'fr_NE',
|
||||
'fr_PF',
|
||||
'fr_PM',
|
||||
'fr_RE',
|
||||
'fr_RW',
|
||||
'fr_SC',
|
||||
'fr_SN',
|
||||
'fr_SY',
|
||||
'fr_TD',
|
||||
'fr_TG',
|
||||
'fr_TN',
|
||||
'fr_VU',
|
||||
'fr_WF',
|
||||
'fr_YT',
|
||||
'fur',
|
||||
'fur_IT',
|
||||
'fy',
|
||||
'fy_DE',
|
||||
'fy_NL',
|
||||
'ga',
|
||||
'ga_IE',
|
||||
'gd',
|
||||
'gd_GB',
|
||||
'gez',
|
||||
'gez_ER',
|
||||
'gez_ET',
|
||||
'gl',
|
||||
'gl_ES',
|
||||
'gom',
|
||||
'gom_Latn',
|
||||
'gsw',
|
||||
'gsw_CH',
|
||||
'gsw_FR',
|
||||
'gsw_LI',
|
||||
'gu',
|
||||
'gu_IN',
|
||||
'guz',
|
||||
'gv',
|
||||
'gv_GB',
|
||||
'ha',
|
||||
'ha_GH',
|
||||
'ha_NE',
|
||||
'ha_NG',
|
||||
'hak',
|
||||
'hak_TW',
|
||||
'haw',
|
||||
'he',
|
||||
'he_IL',
|
||||
'hi',
|
||||
'hi_IN',
|
||||
'hif',
|
||||
'hif_FJ',
|
||||
'hne',
|
||||
'hne_IN',
|
||||
'hr',
|
||||
'hr_BA',
|
||||
'hr_HR',
|
||||
'hsb',
|
||||
'hsb_DE',
|
||||
'ht',
|
||||
'ht_HT',
|
||||
'hu',
|
||||
'hu_HU',
|
||||
'hy',
|
||||
'hy_AM',
|
||||
'i18n',
|
||||
'ia',
|
||||
'ia_FR',
|
||||
'id',
|
||||
'id_ID',
|
||||
'ig',
|
||||
'ig_NG',
|
||||
'ii',
|
||||
'ik',
|
||||
'ik_CA',
|
||||
'in',
|
||||
'is',
|
||||
'is_IS',
|
||||
'it',
|
||||
'it_CH',
|
||||
'it_IT',
|
||||
'it_SM',
|
||||
'it_VA',
|
||||
'iu',
|
||||
'iu_CA',
|
||||
'iw',
|
||||
'ja',
|
||||
'ja_JP',
|
||||
'jgo',
|
||||
'jmc',
|
||||
'jv',
|
||||
'ka',
|
||||
'ka_GE',
|
||||
'kab',
|
||||
'kab_DZ',
|
||||
'kam',
|
||||
'kde',
|
||||
'kea',
|
||||
'khq',
|
||||
'ki',
|
||||
'kk',
|
||||
'kk_KZ',
|
||||
'kkj',
|
||||
'kl',
|
||||
'kl_GL',
|
||||
'kln',
|
||||
'km',
|
||||
'km_KH',
|
||||
'kn',
|
||||
'kn_IN',
|
||||
'ko',
|
||||
'ko_KP',
|
||||
'ko_KR',
|
||||
'kok',
|
||||
'kok_IN',
|
||||
'ks',
|
||||
'ks_IN',
|
||||
'ks_IN@devanagari',
|
||||
'ksb',
|
||||
'ksf',
|
||||
'ksh',
|
||||
'ku',
|
||||
'ku_TR',
|
||||
'kw',
|
||||
'kw_GB',
|
||||
'ky',
|
||||
'ky_KG',
|
||||
'lag',
|
||||
'lb',
|
||||
'lb_LU',
|
||||
'lg',
|
||||
'lg_UG',
|
||||
'li',
|
||||
'li_NL',
|
||||
'lij',
|
||||
'lij_IT',
|
||||
'lkt',
|
||||
'ln',
|
||||
'ln_AO',
|
||||
'ln_CD',
|
||||
'ln_CF',
|
||||
'ln_CG',
|
||||
'lo',
|
||||
'lo_LA',
|
||||
'lrc',
|
||||
'lrc_IQ',
|
||||
'lt',
|
||||
'lt_LT',
|
||||
'lu',
|
||||
'luo',
|
||||
'luy',
|
||||
'lv',
|
||||
'lv_LV',
|
||||
'lzh',
|
||||
'lzh_TW',
|
||||
'mag',
|
||||
'mag_IN',
|
||||
'mai',
|
||||
'mai_IN',
|
||||
'mas',
|
||||
'mas_TZ',
|
||||
'mer',
|
||||
'mfe',
|
||||
'mfe_MU',
|
||||
'mg',
|
||||
'mg_MG',
|
||||
'mgh',
|
||||
'mgo',
|
||||
'mhr',
|
||||
'mhr_RU',
|
||||
'mi',
|
||||
'mi_NZ',
|
||||
'miq',
|
||||
'miq_NI',
|
||||
'mjw',
|
||||
'mjw_IN',
|
||||
'mk',
|
||||
'mk_MK',
|
||||
'ml',
|
||||
'ml_IN',
|
||||
'mn',
|
||||
'mn_MN',
|
||||
'mni',
|
||||
'mni_IN',
|
||||
'mo',
|
||||
'mr',
|
||||
'mr_IN',
|
||||
'ms',
|
||||
'ms_BN',
|
||||
'ms_MY',
|
||||
'ms_SG',
|
||||
'mt',
|
||||
'mt_MT',
|
||||
'mua',
|
||||
'my',
|
||||
'my_MM',
|
||||
'mzn',
|
||||
'nan',
|
||||
'nan_TW',
|
||||
'nan_TW@latin',
|
||||
'naq',
|
||||
'nb',
|
||||
'nb_NO',
|
||||
'nb_SJ',
|
||||
'nd',
|
||||
'nds',
|
||||
'nds_DE',
|
||||
'nds_NL',
|
||||
'ne',
|
||||
'ne_IN',
|
||||
'ne_NP',
|
||||
'nhn',
|
||||
'nhn_MX',
|
||||
'niu',
|
||||
'niu_NU',
|
||||
'nl',
|
||||
'nl_AW',
|
||||
'nl_BE',
|
||||
'nl_BQ',
|
||||
'nl_CW',
|
||||
'nl_NL',
|
||||
'nl_SR',
|
||||
'nl_SX',
|
||||
'nmg',
|
||||
'nn',
|
||||
'nn_NO',
|
||||
'nnh',
|
||||
'no',
|
||||
'nr',
|
||||
'nr_ZA',
|
||||
'nso',
|
||||
'nso_ZA',
|
||||
'nus',
|
||||
'nyn',
|
||||
'oc',
|
||||
'oc_FR',
|
||||
'om',
|
||||
'om_ET',
|
||||
'om_KE',
|
||||
'or',
|
||||
'or_IN',
|
||||
'os',
|
||||
'os_RU',
|
||||
'pa',
|
||||
'pa_Arab',
|
||||
'pa_Guru',
|
||||
'pa_IN',
|
||||
'pa_PK',
|
||||
'pap',
|
||||
'pap_AW',
|
||||
'pap_CW',
|
||||
'pl',
|
||||
'pl_PL',
|
||||
'prg',
|
||||
'ps',
|
||||
'ps_AF',
|
||||
'pt',
|
||||
'pt_AO',
|
||||
'pt_BR',
|
||||
'pt_CH',
|
||||
'pt_CV',
|
||||
'pt_GQ',
|
||||
'pt_GW',
|
||||
'pt_LU',
|
||||
'pt_MO',
|
||||
'pt_MZ',
|
||||
'pt_PT',
|
||||
'pt_ST',
|
||||
'pt_TL',
|
||||
'qu',
|
||||
'qu_BO',
|
||||
'qu_EC',
|
||||
'quz',
|
||||
'quz_PE',
|
||||
'raj',
|
||||
'raj_IN',
|
||||
'rm',
|
||||
'rn',
|
||||
'ro',
|
||||
'ro_MD',
|
||||
'ro_RO',
|
||||
'rof',
|
||||
'ru',
|
||||
'ru_BY',
|
||||
'ru_KG',
|
||||
'ru_KZ',
|
||||
'ru_MD',
|
||||
'ru_RU',
|
||||
'ru_UA',
|
||||
'rw',
|
||||
'rw_RW',
|
||||
'rwk',
|
||||
'sa',
|
||||
'sa_IN',
|
||||
'sah',
|
||||
'sah_RU',
|
||||
'saq',
|
||||
'sat',
|
||||
'sat_IN',
|
||||
'sbp',
|
||||
'sc',
|
||||
'sc_IT',
|
||||
'sd',
|
||||
'sd_IN',
|
||||
'sd_IN@devanagari',
|
||||
'se',
|
||||
'se_FI',
|
||||
'se_NO',
|
||||
'se_SE',
|
||||
'seh',
|
||||
'ses',
|
||||
'sg',
|
||||
'sgs',
|
||||
'sgs_LT',
|
||||
'sh',
|
||||
'shi',
|
||||
'shi_Latn',
|
||||
'shi_Tfng',
|
||||
'shn',
|
||||
'shn_MM',
|
||||
'shs',
|
||||
'shs_CA',
|
||||
'si',
|
||||
'si_LK',
|
||||
'sid',
|
||||
'sid_ET',
|
||||
'sk',
|
||||
'sk_SK',
|
||||
'sl',
|
||||
'sl_SI',
|
||||
'sm',
|
||||
'sm_WS',
|
||||
'smn',
|
||||
'sn',
|
||||
'so',
|
||||
'so_DJ',
|
||||
'so_ET',
|
||||
'so_KE',
|
||||
'so_SO',
|
||||
'sq',
|
||||
'sq_AL',
|
||||
'sq_MK',
|
||||
'sq_XK',
|
||||
'sr',
|
||||
'sr_Cyrl',
|
||||
'sr_Cyrl_BA',
|
||||
'sr_Cyrl_ME',
|
||||
'sr_Cyrl_XK',
|
||||
'sr_Latn',
|
||||
'sr_Latn_BA',
|
||||
'sr_Latn_ME',
|
||||
'sr_Latn_XK',
|
||||
'sr_ME',
|
||||
'sr_RS',
|
||||
'sr_RS@latin',
|
||||
'ss',
|
||||
'ss_ZA',
|
||||
'st',
|
||||
'st_ZA',
|
||||
'sv',
|
||||
'sv_AX',
|
||||
'sv_FI',
|
||||
'sv_SE',
|
||||
'sw',
|
||||
'sw_CD',
|
||||
'sw_KE',
|
||||
'sw_TZ',
|
||||
'sw_UG',
|
||||
'szl',
|
||||
'szl_PL',
|
||||
'ta',
|
||||
'ta_IN',
|
||||
'ta_LK',
|
||||
'ta_MY',
|
||||
'ta_SG',
|
||||
'tcy',
|
||||
'tcy_IN',
|
||||
'te',
|
||||
'te_IN',
|
||||
'teo',
|
||||
'teo_KE',
|
||||
'tet',
|
||||
'tg',
|
||||
'tg_TJ',
|
||||
'th',
|
||||
'th_TH',
|
||||
'the',
|
||||
'the_NP',
|
||||
'ti',
|
||||
'ti_ER',
|
||||
'ti_ET',
|
||||
'tig',
|
||||
'tig_ER',
|
||||
'tk',
|
||||
'tk_TM',
|
||||
'tl',
|
||||
'tl_PH',
|
||||
'tlh',
|
||||
'tn',
|
||||
'tn_ZA',
|
||||
'to',
|
||||
'to_TO',
|
||||
'tpi',
|
||||
'tpi_PG',
|
||||
'tr',
|
||||
'tr_CY',
|
||||
'tr_TR',
|
||||
'ts',
|
||||
'ts_ZA',
|
||||
'tt',
|
||||
'tt_RU',
|
||||
'tt_RU@iqtelif',
|
||||
'twq',
|
||||
'tzl',
|
||||
'tzm',
|
||||
'tzm_Latn',
|
||||
'ug',
|
||||
'ug_CN',
|
||||
'uk',
|
||||
'uk_UA',
|
||||
'unm',
|
||||
'unm_US',
|
||||
'ur',
|
||||
'ur_IN',
|
||||
'ur_PK',
|
||||
'uz',
|
||||
'uz_Arab',
|
||||
'uz_Cyrl',
|
||||
'uz_Latn',
|
||||
'uz_UZ',
|
||||
'uz_UZ@cyrillic',
|
||||
'vai',
|
||||
'vai_Latn',
|
||||
'vai_Vaii',
|
||||
've',
|
||||
've_ZA',
|
||||
'vi',
|
||||
'vi_VN',
|
||||
'vo',
|
||||
'vun',
|
||||
'wa',
|
||||
'wa_BE',
|
||||
'wae',
|
||||
'wae_CH',
|
||||
'wal',
|
||||
'wal_ET',
|
||||
'wo',
|
||||
'wo_SN',
|
||||
'xh',
|
||||
'xh_ZA',
|
||||
'xog',
|
||||
'yav',
|
||||
'yi',
|
||||
'yi_US',
|
||||
'yo',
|
||||
'yo_BJ',
|
||||
'yo_NG',
|
||||
'yue',
|
||||
'yue_HK',
|
||||
'yue_Hans',
|
||||
'yue_Hant',
|
||||
'yuw',
|
||||
'yuw_PG',
|
||||
'zgh',
|
||||
'zh',
|
||||
'zh_CN',
|
||||
'zh_HK',
|
||||
'zh_Hans',
|
||||
'zh_Hans_HK',
|
||||
'zh_Hans_MO',
|
||||
'zh_Hans_SG',
|
||||
'zh_Hant',
|
||||
'zh_Hant_HK',
|
||||
'zh_Hant_MO',
|
||||
'zh_Hant_TW',
|
||||
'zh_MO',
|
||||
'zh_SG',
|
||||
'zh_TW',
|
||||
'zh_YUE',
|
||||
'zu',
|
||||
'zu_ZA',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ use DateTimeInterface;
|
||||
* @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 self setMicrosecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method $this addYears(int|float $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|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval).
|
||||
|
||||
@@ -345,7 +345,7 @@ use DateTimeInterface;
|
||||
* @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 self setMicrosecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonImmutable addYears(int|float $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|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval).
|
||||
|
||||
@@ -14,6 +14,10 @@ declare(strict_types=1);
|
||||
namespace Carbon;
|
||||
|
||||
use BadMethodCallException;
|
||||
use Carbon\Constants\DiffOptions;
|
||||
use Carbon\Constants\Format;
|
||||
use Carbon\Constants\TranslationOptions;
|
||||
use Carbon\Constants\UnitValue;
|
||||
use Carbon\Exceptions\BadComparisonUnitException;
|
||||
use Carbon\Exceptions\ImmutableException;
|
||||
use Carbon\Exceptions\InvalidDateException;
|
||||
@@ -361,7 +365,7 @@ use Throwable;
|
||||
* @method CarbonInterface microseconds(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonInterface microsecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonInterface setMicroseconds(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonInterface setMicrosecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method self setMicrosecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonInterface addYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonInterface addYear() Add one year to the instance (using date interval).
|
||||
* @method CarbonInterface subYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval).
|
||||
@@ -851,127 +855,8 @@ use Throwable;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
interface CarbonInterface extends DateTimeInterface, JsonSerializable, DiffOptions, Format, TranslationOptions, UnitValue
|
||||
{
|
||||
/**
|
||||
* Diff wording options(expressed in octal).
|
||||
*/
|
||||
public const NO_ZERO_DIFF = 01;
|
||||
public const JUST_NOW = 02;
|
||||
public const ONE_DAY_WORDS = 04;
|
||||
public const TWO_DAY_WORDS = 010;
|
||||
public const SEQUENTIAL_PARTS_ONLY = 020;
|
||||
public const ROUND = 040;
|
||||
public const FLOOR = 0100;
|
||||
public const CEIL = 0200;
|
||||
|
||||
/**
|
||||
* Diff syntax options.
|
||||
*/
|
||||
public const DIFF_ABSOLUTE = 1; // backward compatibility with true
|
||||
public const DIFF_RELATIVE_AUTO = 0; // backward compatibility with false
|
||||
public const DIFF_RELATIVE_TO_NOW = 2;
|
||||
public const DIFF_RELATIVE_TO_OTHER = 3;
|
||||
|
||||
/**
|
||||
* Translate string options.
|
||||
*/
|
||||
public const TRANSLATE_MONTHS = 1;
|
||||
public const TRANSLATE_DAYS = 2;
|
||||
public const TRANSLATE_UNITS = 4;
|
||||
public const TRANSLATE_MERIDIEM = 8;
|
||||
public const TRANSLATE_DIFF = 0x10;
|
||||
public const TRANSLATE_ALL = self::TRANSLATE_MONTHS | self::TRANSLATE_DAYS | self::TRANSLATE_UNITS | self::TRANSLATE_MERIDIEM | self::TRANSLATE_DIFF;
|
||||
|
||||
/**
|
||||
* The day constants.
|
||||
*/
|
||||
public const SUNDAY = 0;
|
||||
public const MONDAY = 1;
|
||||
public const TUESDAY = 2;
|
||||
public const WEDNESDAY = 3;
|
||||
public const THURSDAY = 4;
|
||||
public const FRIDAY = 5;
|
||||
public const SATURDAY = 6;
|
||||
|
||||
/**
|
||||
* The month constants.
|
||||
* These aren't used by Carbon itself but exist for
|
||||
* convenience sake alone.
|
||||
*/
|
||||
public const JANUARY = 1;
|
||||
public const FEBRUARY = 2;
|
||||
public const MARCH = 3;
|
||||
public const APRIL = 4;
|
||||
public const MAY = 5;
|
||||
public const JUNE = 6;
|
||||
public const JULY = 7;
|
||||
public const AUGUST = 8;
|
||||
public const SEPTEMBER = 9;
|
||||
public const OCTOBER = 10;
|
||||
public const NOVEMBER = 11;
|
||||
public const DECEMBER = 12;
|
||||
|
||||
/**
|
||||
* Number of X in Y.
|
||||
*/
|
||||
public const YEARS_PER_MILLENNIUM = 1_000;
|
||||
public const YEARS_PER_CENTURY = 100;
|
||||
public const YEARS_PER_DECADE = 10;
|
||||
public const MONTHS_PER_YEAR = 12;
|
||||
public const MONTHS_PER_QUARTER = 3;
|
||||
public const QUARTERS_PER_YEAR = 4;
|
||||
public const WEEKS_PER_YEAR = 52;
|
||||
public const WEEKS_PER_MONTH = 4;
|
||||
public const DAYS_PER_YEAR = 365;
|
||||
public const DAYS_PER_WEEK = 7;
|
||||
public const HOURS_PER_DAY = 24;
|
||||
public const MINUTES_PER_HOUR = 60;
|
||||
public const SECONDS_PER_MINUTE = 60;
|
||||
public const MILLISECONDS_PER_SECOND = 1_000;
|
||||
public const MICROSECONDS_PER_MILLISECOND = 1_000;
|
||||
public const MICROSECONDS_PER_SECOND = 1_000_000;
|
||||
|
||||
/**
|
||||
* Special settings to get the start of week from current locale culture.
|
||||
*/
|
||||
public const WEEK_DAY_AUTO = 'auto';
|
||||
|
||||
/**
|
||||
* RFC7231 DateTime format.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const RFC7231_FORMAT = 'D, d M Y H:i:s \G\M\T';
|
||||
|
||||
/**
|
||||
* Default format to use for __toString method when type juggling occurs.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const DEFAULT_TO_STRING_FORMAT = 'Y-m-d H:i:s';
|
||||
|
||||
/**
|
||||
* Format for converting mocked time, includes microseconds.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const MOCK_DATETIME_FORMAT = 'Y-m-d H:i:s.u';
|
||||
|
||||
/**
|
||||
* Pattern detection for ->isoFormat and ::createFromIsoFormat.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const ISO_FORMAT_REGEXP = '(O[YMDHhms]|[Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY?|g{1,5}|G{1,5}|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?)';
|
||||
|
||||
/**
|
||||
* Default locale (language and region).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const DEFAULT_LOCALE = 'en';
|
||||
|
||||
// <methods>
|
||||
|
||||
/**
|
||||
@@ -1054,15 +939,6 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
#[ReturnTypeWillChange]
|
||||
public static function __set_state($dump): static;
|
||||
|
||||
/**
|
||||
* Returns the list of properties to dump on serialize() called on.
|
||||
*
|
||||
* Only used by PHP < 7.4.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep();
|
||||
|
||||
/**
|
||||
* Format the instance as a string using the set format
|
||||
*
|
||||
@@ -1080,9 +956,9 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
* @example $date->add(15, 'days')
|
||||
* @example $date->add(CarbonInterval::days(4))
|
||||
*
|
||||
* @param Unit|string|DateInterval|Closure|CarbonConverterInterface $unit
|
||||
* @param int|float $value
|
||||
* @param bool|null $overflow
|
||||
* @param Unit|int|string|DateInterval|Closure|CarbonConverterInterface $unit
|
||||
* @param Unit|int|float|string $value
|
||||
* @param bool|null $overflow
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
@@ -1358,7 +1234,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null);
|
||||
public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null): ?static;
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from just a date. The time portion is set to now.
|
||||
@@ -1386,7 +1262,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
* @return static|null
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public static function createFromFormat($format, $time, $timezone = null);
|
||||
public static function createFromFormat($format, $time, $timezone = null): ?static;
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()).
|
||||
@@ -1401,7 +1277,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function createFromIsoFormat(string $format, string $time, $timezone = null, ?string $locale = 'en', ?TranslatorInterface $translator = null);
|
||||
public static function createFromIsoFormat(string $format, string $time, $timezone = null, ?string $locale = 'en', ?TranslatorInterface $translator = null): ?static;
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from a specific format and a string in a given language.
|
||||
@@ -1415,7 +1291,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function createFromLocaleFormat(string $format, string $locale, string $time, $timezone = null);
|
||||
public static function createFromLocaleFormat(string $format, string $locale, string $time, $timezone = null): ?static;
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from a specific ISO format and a string in a given language.
|
||||
@@ -1429,7 +1305,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function createFromLocaleIsoFormat(string $format, string $locale, string $time, $timezone = null);
|
||||
public static function createFromLocaleIsoFormat(string $format, string $locale, string $time, $timezone = null): ?static;
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from just a time. The date portion is set to today.
|
||||
@@ -1457,6 +1333,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* Timestamp input can be given as int, float or a string containing one or more numbers.
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public static function createFromTimestamp(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null): static;
|
||||
|
||||
/**
|
||||
@@ -1525,7 +1402,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null);
|
||||
public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null): ?static;
|
||||
|
||||
/**
|
||||
* Create a new Carbon instance from a specific date and time using strict validation.
|
||||
@@ -2147,13 +2024,22 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
/**
|
||||
* Create an instance from a serialized string.
|
||||
*
|
||||
* @param string $value
|
||||
* If $value is not from a trusted source, consider using the allowed_classes option to limit
|
||||
* the types of objects that can be built, for instance:
|
||||
*
|
||||
* @example
|
||||
* ```php
|
||||
* $object = Carbon::fromSerialized($value, ['allowed_classes' => [Carbon::class, CarbonImmutable::class]]);
|
||||
* ```
|
||||
*
|
||||
* @param \Stringable|string $value
|
||||
* @param array $options example: ['allowed_classes' => [CarbonImmutable::class]]
|
||||
*
|
||||
* @throws InvalidFormatException
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function fromSerialized($value): static;
|
||||
public static function fromSerialized($value, array $options = []): static;
|
||||
|
||||
/**
|
||||
* Register a custom macro.
|
||||
@@ -3376,7 +3262,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
* echo Carbon::yesterday()->hours(11)->userFormat();
|
||||
* ```
|
||||
*
|
||||
* @param-closure-this static $macro
|
||||
* @param-closure-this static $macro
|
||||
*/
|
||||
public static function macro(string $name, ?callable $macro): void;
|
||||
|
||||
@@ -3392,7 +3278,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function make($var, DateTimeZone|string|null $timezone = null);
|
||||
public static function make($var, DateTimeZone|string|null $timezone = null): ?static;
|
||||
|
||||
/**
|
||||
* Get the maximum instance between a given instance (default now) and the current instance.
|
||||
@@ -3678,7 +3564,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* @return static|null
|
||||
*/
|
||||
public static function rawCreateFromFormat(string $format, string $time, $timezone = null);
|
||||
public static function rawCreateFromFormat(string $format, string $time, $timezone = null): ?static;
|
||||
|
||||
/**
|
||||
* @see https://php.net/manual/en/datetime.format.php
|
||||
@@ -4232,9 +4118,9 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
* @example $date->sub(15, 'days')
|
||||
* @example $date->sub(CarbonInterval::days(4))
|
||||
*
|
||||
* @param Unit|string|DateInterval|Closure|CarbonConverterInterface $unit
|
||||
* @param int|float $value
|
||||
* @param bool|null $overflow
|
||||
* @param Unit|int|string|DateInterval|Closure|CarbonConverterInterface $unit
|
||||
* @param Unit|int|float|string $value
|
||||
* @param bool|null $overflow
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
@@ -4284,9 +4170,9 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
*
|
||||
* @see sub()
|
||||
*
|
||||
* @param string|DateInterval $unit
|
||||
* @param int|float $value
|
||||
* @param bool|null $overflow
|
||||
* @param Unit|int|string|DateInterval $unit
|
||||
* @param Unit|int|float|string $value
|
||||
* @param bool|null $overflow
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
@@ -4755,7 +4641,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
public static function translateTimeString(string $timeString, ?string $from = null, ?string $to = null, int $mode = self::TRANSLATE_ALL): string;
|
||||
|
||||
/**
|
||||
* Translate a time string from the current locale (`$date->locale()`) to an other.
|
||||
* Translate a time string from the current locale (`$date->locale()`) to another one.
|
||||
*
|
||||
* @param string $timeString time string to translate
|
||||
* @param string|null $to output locale of the result returned ("en" by default)
|
||||
@@ -4784,6 +4670,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
|
||||
|
||||
/**
|
||||
* Set the timezone or returns the timezone name if no arguments passed.
|
||||
*
|
||||
* @return ($value is null ? string : static)
|
||||
*/
|
||||
public function tz(DateTimeZone|string|int|null $value = null): static|string;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Carbon;
|
||||
|
||||
use Carbon\Constants\UnitValue;
|
||||
use Carbon\Exceptions\BadFluentConstructorException;
|
||||
use Carbon\Exceptions\BadFluentSetterException;
|
||||
use Carbon\Exceptions\InvalidCastException;
|
||||
@@ -191,7 +192,7 @@ use Throwable;
|
||||
* @method $this ceilMicrosecond(int|float $precision = 1) Ceil the current instance microsecond with given precision.
|
||||
* @method $this ceilMicroseconds(int|float $precision = 1) Ceil the current instance microsecond with given precision.
|
||||
*/
|
||||
class CarbonInterval extends DateInterval implements CarbonConverterInterface
|
||||
class CarbonInterval extends DateInterval implements CarbonConverterInterface, UnitValue
|
||||
{
|
||||
use LocalFactory;
|
||||
use IntervalRounding;
|
||||
|
||||
@@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Carbon;
|
||||
|
||||
use Carbon\Constants\UnitValue;
|
||||
use Carbon\Exceptions\EndLessPeriodException;
|
||||
use Carbon\Exceptions\InvalidCastException;
|
||||
use Carbon\Exceptions\InvalidIntervalException;
|
||||
@@ -180,7 +181,7 @@ require PHP_VERSION < 8.2
|
||||
* @SuppressWarnings(CamelCasePropertyName)
|
||||
* @SuppressWarnings(CouplingBetweenObjects)
|
||||
*/
|
||||
class CarbonPeriod extends DatePeriodBase implements Countable, JsonSerializable
|
||||
class CarbonPeriod extends DatePeriodBase implements Countable, JsonSerializable, UnitValue
|
||||
{
|
||||
use LocalFactory;
|
||||
use IntervalRounding;
|
||||
|
||||
37
plugins/vendor/nesbot/carbon/src/Carbon/Constants/DiffOptions.php
vendored
Normal file
37
plugins/vendor/nesbot/carbon/src/Carbon/Constants/DiffOptions.php
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* 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\Constants;
|
||||
|
||||
interface DiffOptions
|
||||
{
|
||||
/**
|
||||
* Diff wording options(expressed in octal).
|
||||
*/
|
||||
public const NO_ZERO_DIFF = 01;
|
||||
public const JUST_NOW = 02;
|
||||
public const ONE_DAY_WORDS = 04;
|
||||
public const TWO_DAY_WORDS = 010;
|
||||
public const SEQUENTIAL_PARTS_ONLY = 020;
|
||||
public const ROUND = 040;
|
||||
public const FLOOR = 0100;
|
||||
public const CEIL = 0200;
|
||||
|
||||
/**
|
||||
* Diff syntax options.
|
||||
*/
|
||||
public const DIFF_ABSOLUTE = 1; // backward compatibility with true
|
||||
public const DIFF_RELATIVE_AUTO = 0; // backward compatibility with false
|
||||
public const DIFF_RELATIVE_TO_NOW = 2;
|
||||
public const DIFF_RELATIVE_TO_OTHER = 3;
|
||||
}
|
||||
45
plugins/vendor/nesbot/carbon/src/Carbon/Constants/Format.php
vendored
Normal file
45
plugins/vendor/nesbot/carbon/src/Carbon/Constants/Format.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* 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\Constants;
|
||||
|
||||
interface Format
|
||||
{
|
||||
/**
|
||||
* RFC7231 DateTime format.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const RFC7231_FORMAT = 'D, d M Y H:i:s \G\M\T';
|
||||
|
||||
/**
|
||||
* Default format to use for __toString method when type juggling occurs.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const DEFAULT_TO_STRING_FORMAT = 'Y-m-d H:i:s';
|
||||
|
||||
/**
|
||||
* Format for converting mocked time, includes microseconds.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const MOCK_DATETIME_FORMAT = 'Y-m-d H:i:s.u';
|
||||
|
||||
/**
|
||||
* Pattern detection for ->isoFormat and ::createFromIsoFormat.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const ISO_FORMAT_REGEXP = '(O[YMDHhms]|[Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY?|g{1,5}|G{1,5}|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?)';
|
||||
}
|
||||
39
plugins/vendor/nesbot/carbon/src/Carbon/Constants/TranslationOptions.php
vendored
Normal file
39
plugins/vendor/nesbot/carbon/src/Carbon/Constants/TranslationOptions.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* 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\Constants;
|
||||
|
||||
interface TranslationOptions
|
||||
{
|
||||
/**
|
||||
* Translate string options.
|
||||
*/
|
||||
public const TRANSLATE_MONTHS = 1;
|
||||
public const TRANSLATE_DAYS = 2;
|
||||
public const TRANSLATE_UNITS = 4;
|
||||
public const TRANSLATE_MERIDIEM = 8;
|
||||
public const TRANSLATE_DIFF = 0x10;
|
||||
public const TRANSLATE_ALL = self::TRANSLATE_MONTHS | self::TRANSLATE_DAYS | self::TRANSLATE_UNITS | self::TRANSLATE_MERIDIEM | self::TRANSLATE_DIFF;
|
||||
|
||||
/**
|
||||
* Special settings to get the start of week from current locale culture.
|
||||
*/
|
||||
public const WEEK_DAY_AUTO = 'auto';
|
||||
|
||||
/**
|
||||
* Default locale (language and region).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const DEFAULT_LOCALE = 'en';
|
||||
}
|
||||
66
plugins/vendor/nesbot/carbon/src/Carbon/Constants/UnitValue.php
vendored
Normal file
66
plugins/vendor/nesbot/carbon/src/Carbon/Constants/UnitValue.php
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* 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\Constants;
|
||||
|
||||
interface UnitValue
|
||||
{
|
||||
/**
|
||||
* The day constants.
|
||||
*/
|
||||
public const SUNDAY = 0;
|
||||
public const MONDAY = 1;
|
||||
public const TUESDAY = 2;
|
||||
public const WEDNESDAY = 3;
|
||||
public const THURSDAY = 4;
|
||||
public const FRIDAY = 5;
|
||||
public const SATURDAY = 6;
|
||||
|
||||
/**
|
||||
* The month constants.
|
||||
* These aren't used by Carbon itself but exist for
|
||||
* convenience's sake alone.
|
||||
*/
|
||||
public const JANUARY = 1;
|
||||
public const FEBRUARY = 2;
|
||||
public const MARCH = 3;
|
||||
public const APRIL = 4;
|
||||
public const MAY = 5;
|
||||
public const JUNE = 6;
|
||||
public const JULY = 7;
|
||||
public const AUGUST = 8;
|
||||
public const SEPTEMBER = 9;
|
||||
public const OCTOBER = 10;
|
||||
public const NOVEMBER = 11;
|
||||
public const DECEMBER = 12;
|
||||
|
||||
/**
|
||||
* Number of X in Y.
|
||||
*/
|
||||
public const YEARS_PER_MILLENNIUM = 1_000;
|
||||
public const YEARS_PER_CENTURY = 100;
|
||||
public const YEARS_PER_DECADE = 10;
|
||||
public const MONTHS_PER_YEAR = 12;
|
||||
public const MONTHS_PER_QUARTER = 3;
|
||||
public const QUARTERS_PER_YEAR = 4;
|
||||
public const WEEKS_PER_YEAR = 52;
|
||||
public const WEEKS_PER_MONTH = 4;
|
||||
public const DAYS_PER_YEAR = 365;
|
||||
public const DAYS_PER_WEEK = 7;
|
||||
public const HOURS_PER_DAY = 24;
|
||||
public const MINUTES_PER_HOUR = 60;
|
||||
public const SECONDS_PER_MINUTE = 60;
|
||||
public const MILLISECONDS_PER_SECOND = 1_000;
|
||||
public const MICROSECONDS_PER_MILLISECOND = 1_000;
|
||||
public const MICROSECONDS_PER_SECOND = 1_000_000;
|
||||
}
|
||||
@@ -65,7 +65,9 @@ use Throwable;
|
||||
* @method Carbon createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $timezone = null) Create a new Carbon instance from a specific date and time using strict validation.
|
||||
* @method mixed executeWithLocale(string $locale, callable $func) Set the current locale to the given, execute the passed function, reset the locale to previous one,
|
||||
* then return the result of the closure (or null if the closure was void).
|
||||
* @method Carbon fromSerialized($value) Create an instance from a serialized string.
|
||||
* @method Carbon fromSerialized($value, array $options = []) Create an instance from a serialized string.
|
||||
* If $value is not from a trusted source, consider using the allowed_classes option to limit
|
||||
* the types of objects that can be built, for instance:
|
||||
* @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales.
|
||||
* (It will ignore custom translator dynamic loading.)
|
||||
* @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native
|
||||
@@ -639,12 +641,13 @@ class Factory
|
||||
*/
|
||||
public function withTestNow(mixed $testNow, callable $callback): mixed
|
||||
{
|
||||
$previousTestNow = $this->getTestNow();
|
||||
$this->setTestNow($testNow);
|
||||
|
||||
try {
|
||||
$result = $callback();
|
||||
} finally {
|
||||
$this->setTestNow();
|
||||
$this->setTestNow($previousTestNow);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
@@ -62,7 +62,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
* @method CarbonImmutable createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $timezone = null) Create a new Carbon instance from a specific date and time using strict validation.
|
||||
* @method mixed executeWithLocale(string $locale, callable $func) Set the current locale to the given, execute the passed function, reset the locale to previous one,
|
||||
* then return the result of the closure (or null if the closure was void).
|
||||
* @method CarbonImmutable fromSerialized($value) Create an instance from a serialized string.
|
||||
* @method CarbonImmutable fromSerialized($value, array $options = []) Create an instance from a serialized string.
|
||||
* If $value is not from a trusted source, consider using the allowed_classes option to limit
|
||||
* the types of objects that can be built, for instance:
|
||||
* @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales.
|
||||
* (It will ignore custom translator dynamic loading.)
|
||||
* @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native
|
||||
|
||||
@@ -119,7 +119,6 @@ return [
|
||||
},
|
||||
'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'],
|
||||
'months_short' => ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'],
|
||||
'months_standalone' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'İyun', 'İyul', 'Avqust', 'Sentyabr', 'Oktyabr', 'Noyabr', 'Dekabr'],
|
||||
'weekdays' => ['bazar', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə'],
|
||||
'weekdays_short' => ['baz', 'bze', 'çax', 'çər', 'cax', 'cüm', 'şən'],
|
||||
'weekdays_min' => ['bz', 'be', 'ça', 'çə', 'ca', 'cü', 'şə'],
|
||||
|
||||
27
plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_Arab.php
vendored
Normal file
27
plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_Arab.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Mousa Moradi mousamk@gmail.com
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'OY/OM/OD',
|
||||
],
|
||||
'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مئی', 'ژوئن', 'جولای', 'آقۇست', 'سپتامبر', 'اوْکتوْبر', 'نوْوامبر', 'دسامبر'],
|
||||
'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مئی', 'ژوئن', 'جولای', 'آقۇست', 'سپتامبر', 'اوْکتوْبر', 'نوْوامبر', 'دسامبر'],
|
||||
'weekdays' => ['یکشنبه', 'دوشنبه', 'سهشنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'],
|
||||
'weekdays_short' => ['یکشنبه', 'دوشنبه', 'سهشنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'],
|
||||
'weekdays_min' => ['یکشنبه', 'دوشنبه', 'سهشنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'],
|
||||
'first_day_of_week' => 6,
|
||||
'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰۴', '۰۵', '۰۶', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱۴', '۱۵', '۱۶', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲۴', '۲۵', '۲۶', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳۴', '۳۵', '۳۶', '۳۷', '۳۸', '۳۹', '۴۰', '۴۱', '۴۲', '۴۳', '۴۴', '۴۵', '۴۶', '۴۷', '۴۸', '۴۹', '۵۰', '۵۱', '۵۲', '۵۳', '۵۴', '۵۵', '۵۶', '۵۷', '۵۸', '۵۹', '۶۰', '۶۱', '۶۲', '۶۳', '۶۴', '۶۵', '۶۶', '۶۷', '۶۸', '۶۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷۴', '۷۵', '۷۶', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸۴', '۸۵', '۸۶', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹۴', '۹۵', '۹۶', '۹۷', '۹۸', '۹۹'],
|
||||
]);
|
||||
@@ -15,6 +15,5 @@ return array_replace_recursive(require __DIR__.'/az.php', [
|
||||
'weekdays_min' => ['Б.', 'Б.Е.', 'Ч.А.', 'Ч.', 'Ҹ.А.', 'Ҹ.', 'Ш.'],
|
||||
'months' => ['јанвар', 'феврал', 'март', 'апрел', 'май', 'ијун', 'ијул', 'август', 'сентјабр', 'октјабр', 'нојабр', 'декабр'],
|
||||
'months_short' => ['јан', 'фев', 'мар', 'апр', 'май', 'ијн', 'ијл', 'авг', 'сен', 'окт', 'ној', 'дек'],
|
||||
'months_standalone' => ['Јанвар', 'Феврал', 'Март', 'Апрел', 'Май', 'Ијун', 'Ијул', 'Август', 'Сентјабр', 'Октјабр', 'Нојабр', 'Декабр'],
|
||||
'meridiem' => ['а', 'п'],
|
||||
]);
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Mousa Moradi mousamk@gmail.com
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'formats' => [
|
||||
'L' => 'OY/OM/OD',
|
||||
|
||||
@@ -16,7 +16,6 @@ return array_replace_recursive(require __DIR__.'/az.php', [
|
||||
'weekdays_min' => ['B.', 'B.E.', 'Ç.A.', 'Ç.', 'C.A.', 'C.', 'Ş.'],
|
||||
'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'],
|
||||
'months_short' => ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'],
|
||||
'months_standalone' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'İyun', 'İyul', 'Avqust', 'Sentyabr', 'Oktyabr', 'Noyabr', 'Dekabr'],
|
||||
'first_day_of_week' => 1,
|
||||
'formats' => [
|
||||
'LT' => 'HH:mm',
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
$bengaliNumbers = ['০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯'];
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* - Josh Soref
|
||||
@@ -18,6 +20,7 @@
|
||||
* - JD Isaacks
|
||||
* - Saiful Islam
|
||||
* - Faisal Islam
|
||||
* - Hayatunnabi Nabil
|
||||
*/
|
||||
return [
|
||||
'year' => ':count বছর',
|
||||
@@ -41,6 +44,12 @@ return [
|
||||
'second' => ':count সেকেন্ড',
|
||||
'a_second' => 'কয়েক সেকেন্ড|:count সেকেন্ড',
|
||||
's' => '১ সেকেন্ড|:count সেকেন্ড',
|
||||
'millisecond' => ':count মিলিসেকেন্ড',
|
||||
'a_millisecond' => 'এক মিলিসেকেন্ড|:count মিলিসেকেন্ড',
|
||||
'ms' => '১ মিলিসেকেন্ড|:count মিলিসেকেন্ড',
|
||||
'microsecond' => ':count মাইক্রোসেকেন্ড',
|
||||
'a_microsecond' => 'এক মাইক্রোসেকেন্ড|:count মাইক্রোসেকেন্ড',
|
||||
'µs' => '১ মাইক্রোসেকেন্ড|:count মাইক্রোসেকেন্ড',
|
||||
'ago' => ':time আগে',
|
||||
'from_now' => ':time পরে',
|
||||
'after' => ':time পরে',
|
||||
@@ -49,6 +58,8 @@ return [
|
||||
'diff_today' => 'আজ',
|
||||
'diff_yesterday' => 'গতকাল',
|
||||
'diff_tomorrow' => 'আগামীকাল',
|
||||
'diff_before_yesterday' => 'গত পরশু',
|
||||
'diff_after_tomorrow' => 'আগামী পরশু',
|
||||
'period_recurrences' => ':count বার|:count বার',
|
||||
'period_interval' => 'প্রতি :interval',
|
||||
'period_start_date' => ':date থেকে',
|
||||
@@ -90,11 +101,53 @@ return [
|
||||
'weekdays' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'],
|
||||
'weekdays_short' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'],
|
||||
'weekdays_min' => ['রবি', 'সোম', 'মঙ্গ', 'বুধ', 'বৃহঃ', 'শুক্র', 'শনি'],
|
||||
'ordinal' => static function ($number) use ($bengaliNumbers) {
|
||||
// Convert to Bengali numerals
|
||||
$bengaliNumber = str_replace(
|
||||
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
$bengaliNumbers,
|
||||
(string) $number
|
||||
);
|
||||
|
||||
// Apply Bengali ordinal rules
|
||||
$lastDigit = $number % 10;
|
||||
$lastTwoDigits = $number % 100;
|
||||
|
||||
// Special cases for teens (11-19) always use তম
|
||||
if ($lastTwoDigits >= 11 && $lastTwoDigits <= 19) {
|
||||
return $bengaliNumber.'তম';
|
||||
}
|
||||
|
||||
// For numbers 1-10, use specific rules
|
||||
if ($number <= 10) {
|
||||
switch ($number) {
|
||||
case 1:
|
||||
case 5:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
return $bengaliNumber.'ম';
|
||||
case 2:
|
||||
case 3:
|
||||
return $bengaliNumber.'য়';
|
||||
case 4:
|
||||
return $bengaliNumber.'র্থ';
|
||||
case 6:
|
||||
return $bengaliNumber.'ষ্ঠ';
|
||||
default:
|
||||
return $bengaliNumber.'তম';
|
||||
}
|
||||
}
|
||||
|
||||
// For numbers > 20, all use তম
|
||||
return $bengaliNumber.'তম';
|
||||
},
|
||||
'list' => [', ', ' এবং '],
|
||||
'first_day_of_week' => 0,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'weekdays_standalone' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহষ্পতিবার', 'শুক্রবার', 'শনিবার'],
|
||||
'weekdays_min_standalone' => ['রঃ', 'সোঃ', 'মঃ', 'বুঃ', 'বৃঃ', 'শুঃ', 'শনি'],
|
||||
'months_short_standalone' => ['জানুয়ারী', 'ফেব্রুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'],
|
||||
'alt_numbers' => ['০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯'],
|
||||
'alt_numbers' => $bengaliNumbers,
|
||||
];
|
||||
|
||||
@@ -44,10 +44,17 @@ return [
|
||||
'second' => ':count δευτερόλεπτο|:count δευτερόλεπτα',
|
||||
'a_second' => 'λίγα δευτερόλεπτα|:count δευτερόλεπτα',
|
||||
's' => ':count δευ.',
|
||||
|
||||
'ago' => 'πριν :time',
|
||||
'from_now' => 'σε :time',
|
||||
'after' => ':time μετά',
|
||||
'before' => ':time πριν',
|
||||
|
||||
'year_ago' => ':count χρόνο|:count χρόνια',
|
||||
'year_from_now' => ':count χρόνο|:count χρόνια',
|
||||
'month_ago' => ':count μήνα|:count μήνες',
|
||||
'month_from_now' => ':count μήνα|:count μήνες',
|
||||
|
||||
'diff_now' => 'τώρα',
|
||||
'diff_today' => 'Σήμερα',
|
||||
'diff_today_regexp' => 'Σήμερα(?:\\s+{})?',
|
||||
@@ -55,6 +62,7 @@ return [
|
||||
'diff_yesterday_regexp' => 'Χθες(?:\\s+{})?',
|
||||
'diff_tomorrow' => 'αύριο',
|
||||
'diff_tomorrow_regexp' => 'Αύριο(?:\\s+{})?',
|
||||
|
||||
'formats' => [
|
||||
'LT' => 'h:mm A',
|
||||
'LTS' => 'h:mm:ss A',
|
||||
|
||||
@@ -92,4 +92,5 @@ return [
|
||||
'list' => [', ', ' and '],
|
||||
'first_day_of_week' => 1,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
'meridiem' => ['AM', 'PM'],
|
||||
];
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* Authors:
|
||||
* - information from Kenneth Christiansen Kenneth Christiansen, Pablo Saratxaga kenneth@gnu.org, pablo@mandriva.com
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
return array_replace_recursive(require __DIR__.'/fy.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD.MM.YYYY',
|
||||
],
|
||||
|
||||
@@ -22,6 +22,4 @@ return array_replace_recursive(require __DIR__.'/fy.php', [
|
||||
'weekdays' => ['Snein', 'Moandei', 'Tiisdei', 'Woansdei', 'Tongersdei', 'Freed', 'Sneon'],
|
||||
'weekdays_short' => ['Sn', 'Mo', 'Ti', 'Wo', 'To', 'Fr', 'Sn'],
|
||||
'weekdays_min' => ['Sn', 'Mo', 'Ti', 'Wo', 'To', 'Fr', 'Sn'],
|
||||
'first_day_of_week' => 1,
|
||||
'day_of_first_week_of_year' => 4,
|
||||
]);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* Authors:
|
||||
* - bug-glibc-locales@gnu.org
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
return array_replace_recursive(require __DIR__.'/pa_Arab.php', [
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YYYY',
|
||||
],
|
||||
|
||||
@@ -119,8 +119,10 @@ return [
|
||||
},
|
||||
'sameElse' => 'L',
|
||||
],
|
||||
'months' => ['januar', 'februar', 'marec', 'april', 'maj', 'junij', 'julij', 'avgust', 'september', 'oktober', 'november', 'december'],
|
||||
'months' => ['januarja', 'februarja', 'marca', 'aprila', 'maja', 'junija', 'julija', 'avgusta', 'septembra', 'oktobra', 'novembra', 'decembra'],
|
||||
'months_standalone' => ['januar', 'februar', 'marec', 'april', 'maj', 'junij', 'julij', 'avgust', 'september', 'oktober', 'november', 'december'],
|
||||
'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'avg', 'sep', 'okt', 'nov', 'dec'],
|
||||
'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/',
|
||||
'weekdays' => ['nedelja', 'ponedeljek', 'torek', 'sreda', 'četrtek', 'petek', 'sobota'],
|
||||
'weekdays_short' => ['ned', 'pon', 'tor', 'sre', 'čet', 'pet', 'sob'],
|
||||
'weekdays_min' => ['ne', 'po', 'to', 'sr', 'če', 'pe', 'so'],
|
||||
|
||||
@@ -14,42 +14,59 @@
|
||||
* - http://www.uyip.org/ Pablo Saratxaga pablo@mandrakesoft.com
|
||||
*/
|
||||
return array_replace_recursive(require __DIR__.'/en.php', [
|
||||
'year' => '{1}:count יאר|{0}:count יאר|[-Inf,Inf]:count יאר',
|
||||
'a_year' => '{1}א יאר|{0}:count יאר|[-Inf,Inf]:count יאר',
|
||||
'y' => ':count יאר',
|
||||
'month' => '{1}:count חודש|{0}:count חדשים|[-Inf,Inf]:count חדשים',
|
||||
'a_month' => '{1}א חודש|{0}:count חדשים|[-Inf,Inf]:count חדשים',
|
||||
'm' => '{1}:count חודש|{0}:count חדשים|[-Inf,Inf]:count חדשים',
|
||||
'week' => '{1}:count וואך|{0}:count וואכן|[-Inf,Inf]:count וואכן',
|
||||
'a_week' => '{1}א וואך|{0}:count וואכן|[-Inf,Inf]:count וואכן',
|
||||
'w' => ':count וואך',
|
||||
'day' => '{1}:count טאג|{0}:count טעג|[-Inf,Inf]:count טעג',
|
||||
'a_day' => '{1}א טאג|{0}:count טעג|[-Inf,Inf]:count טעג',
|
||||
'd' => ':count טאג',
|
||||
'hour' => ':count שעה',
|
||||
'a_hour' => 'א שעה',
|
||||
'h' => ':count שעה',
|
||||
'minute' => '{1}:count מינוט|{0}:count מינוט|[-Inf,Inf]:count מינוט',
|
||||
'a_minute' => '{1}א מינוט|{0}:count מינוט|[-Inf,Inf]:count מינוט',
|
||||
'min' => ':count מינוט',
|
||||
'second' => '{1}:count סעקונדע|{0}:count סעקונדעס|[-Inf,Inf]:count סעקונדעס',
|
||||
'a_second' => '{0,1}א סעקונדע|[-Inf,Inf]:count סעקונדעס',
|
||||
's' => ':count סעק',
|
||||
'millisecond' => '{1}:count מילי-סעקונדע|{0}:count מילי-סעקונדעס|[-Inf,Inf]:count מילי-סעקונדעס',
|
||||
'a_millisecond' => '{1}א מילי-סעקונדע|{0}:count מילי-סעקונדעס|[-Inf,Inf]:count מילי-סעקונדעס',
|
||||
'ms' => ':count מס',
|
||||
'microsecond' => '{1}:count מיקרא-סעקונדע|{0}:count מיקרא-סעקונדעס|[-Inf,Inf]:count מיקרא-סעקונדעס',
|
||||
'a_microsecond' => '{1}א מיקרא-סעקונדע|{0}:count מיקרא-סעקונדעס|[-Inf,Inf]:count מיקרא-סעקונדעס',
|
||||
'µs' => ':count מיקרא',
|
||||
'ago' => ':time פון יעצט',
|
||||
'from_now' => ':time ארום',
|
||||
'after' => ':time נאך',
|
||||
'before' => ':time פאר',
|
||||
'diff_now' => 'ממש יעצט',
|
||||
'diff_today' => 'היינט',
|
||||
'diff_yesterday' => 'נעכטן',
|
||||
'diff_tomorrow' => 'מארגן',
|
||||
'diff_before_yesterday' => 'אייער-נעכטן',
|
||||
'diff_after_tomorrow' => 'איבער-מארגן',
|
||||
'period_recurrences' => '{1}איין מאל|{0}:count מאל|[-Inf,Inf]:count מאל',
|
||||
'period_interval' => 'יעדע :interval',
|
||||
'period_start_date' => 'פון :date',
|
||||
'period_end_date' => 'ביז :date',
|
||||
'months' => ['יאנואר', 'פעברואר', 'מארטש', 'אפריל', 'מאי', 'יוני', 'יולי', 'אויגוסט', 'סעפטעמבער', 'אקטאבער', 'נאוועמבער', 'דעצעמבער'],
|
||||
'months_short' => ['יאנ\'', 'פעב\'', 'מאר\'', 'אפר\'', 'מאי', 'יוני', 'יולי', 'אויג\'', 'סעפ\'', 'אקט\'', 'נאו\'', 'דעצ\''],
|
||||
'weekdays' => ['זונטאג', 'מאנטאג', 'דינסטאג', 'מיטוואך', 'דאנערשטאג', 'פרייטאג', 'שבת'],
|
||||
'weekdays_short' => ['זונ\'', 'מאנ\'', 'דינ\'', 'מיט\'', 'דאנ\'', 'פריי\'', 'שבת'],
|
||||
'weekdays_min' => ['ז\'', 'מ\'', 'ד\'', 'מ\'', 'ד\'', 'ו\'', 'ש\''],
|
||||
'ordinal' => static function ($number) {
|
||||
return $number.'טע';
|
||||
},
|
||||
'list' => [', ', ' און '],
|
||||
'formats' => [
|
||||
'L' => 'DD/MM/YY',
|
||||
],
|
||||
'months' => ['יאַנואַר', 'פֿעברואַר', 'מערץ', 'אַפּריל', 'מיי', 'יוני', 'יולי', 'אויגוסט', 'סעפּטעמבער', 'אקטאבער', 'נאוועמבער', 'דעצעמבער'],
|
||||
'months_short' => ['יאַנ', 'פֿעב', 'מאַר', 'אַפּר', 'מײַ ', 'יונ', 'יול', 'אױג', 'סעפּ', 'אָקט', 'נאָװ', 'דעצ'],
|
||||
'weekdays' => ['זונטיק', 'מאָנטיק', 'דינסטיק', 'מיטװאָך', 'דאָנערשטיק', 'פֿרײַטיק', 'שבת'],
|
||||
'weekdays_short' => ['זונ\'', 'מאָנ\'', 'דינ\'', 'מיט\'', 'דאָנ\'', 'פֿרײַ\'', 'שבת'],
|
||||
'weekdays_min' => ['זונ\'', 'מאָנ\'', 'דינ\'', 'מיט\'', 'דאָנ\'', 'פֿרײַ\'', 'שבת'],
|
||||
'first_day_of_week' => 0,
|
||||
'day_of_first_week_of_year' => 1,
|
||||
|
||||
'year' => ':count יאר',
|
||||
'y' => ':count יאר',
|
||||
'a_year' => ':count יאר',
|
||||
|
||||
'month' => ':count חודש',
|
||||
'm' => ':count חודש',
|
||||
'a_month' => ':count חודש',
|
||||
|
||||
'week' => ':count וואָך',
|
||||
'w' => ':count וואָך',
|
||||
'a_week' => ':count וואָך',
|
||||
|
||||
'day' => ':count טאָג',
|
||||
'd' => ':count טאָג',
|
||||
'a_day' => ':count טאָג',
|
||||
|
||||
'hour' => ':count שעה',
|
||||
'h' => ':count שעה',
|
||||
'a_hour' => ':count שעה',
|
||||
|
||||
'minute' => ':count מינוט',
|
||||
'min' => ':count מינוט',
|
||||
'a_minute' => ':count מינוט',
|
||||
|
||||
'second' => ':count סעקונדע',
|
||||
's' => ':count סעקונדע',
|
||||
'a_second' => ':count סעקונדע',
|
||||
]);
|
||||
|
||||
@@ -596,7 +596,7 @@ return [
|
||||
'nativeName' => 'Slovenčina, Slovenský Jazyk',
|
||||
],
|
||||
'sl' => [
|
||||
'isoName' => 'Slovene',
|
||||
'isoName' => 'Slovenian',
|
||||
'nativeName' => 'Slovenski Jezik, Slovenščina',
|
||||
],
|
||||
'so' => [
|
||||
|
||||
@@ -50,7 +50,7 @@ trait Creator
|
||||
/**
|
||||
* The errors that can occur.
|
||||
*/
|
||||
protected static ?array $lastErrors = null;
|
||||
protected static array|bool $lastErrors = false;
|
||||
|
||||
/**
|
||||
* Create a new Carbon instance.
|
||||
@@ -905,14 +905,7 @@ trait Creator
|
||||
*/
|
||||
private static function setLastErrors($lastErrors): void
|
||||
{
|
||||
if (\is_array($lastErrors) || $lastErrors === false) {
|
||||
static::$lastErrors = \is_array($lastErrors) ? $lastErrors : [
|
||||
'warning_count' => 0,
|
||||
'warnings' => [],
|
||||
'error_count' => 0,
|
||||
'errors' => [],
|
||||
];
|
||||
}
|
||||
static::$lastErrors = $lastErrors;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -920,7 +913,7 @@ trait Creator
|
||||
*/
|
||||
public static function getLastErrors(): array|false
|
||||
{
|
||||
return static::$lastErrors ?? false;
|
||||
return static::$lastErrors;
|
||||
}
|
||||
|
||||
private static function monthToInt(mixed $value, string $unit = 'month'): mixed
|
||||
|
||||
@@ -372,7 +372,7 @@ use Throwable;
|
||||
* @method CarbonInterface microseconds(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonInterface microsecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonInterface setMicroseconds(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonInterface setMicrosecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method self setMicrosecond(int $value) Set current instance microsecond to the given value.
|
||||
* @method CarbonInterface addYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval).
|
||||
* @method CarbonInterface addYear() Add one year to the instance (using date interval).
|
||||
* @method CarbonInterface subYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval).
|
||||
@@ -2670,7 +2670,7 @@ trait Date
|
||||
protected function getTranslatedFormByRegExp($baseKey, $keySuffix, $context, $subKey, $defaultValue)
|
||||
{
|
||||
$key = $baseKey.$keySuffix;
|
||||
$standaloneKey = "{$key}_standalone";
|
||||
$standaloneKey = $key.'_standalone';
|
||||
$baseTranslation = $this->getTranslationMessage($key);
|
||||
|
||||
if ($baseTranslation instanceof Closure) {
|
||||
@@ -2679,7 +2679,7 @@ trait Date
|
||||
|
||||
if (
|
||||
$this->getTranslationMessage("$standaloneKey.$subKey") &&
|
||||
(!$context || (($regExp = $this->getTranslationMessage("{$baseKey}_regexp")) && !preg_match($regExp, $context)))
|
||||
(!$context || (($regExp = $this->getTranslationMessage($baseKey.'_regexp')) && !preg_match($regExp, $context)))
|
||||
) {
|
||||
$key = $standaloneKey;
|
||||
}
|
||||
|
||||
@@ -275,18 +275,18 @@ trait Localization
|
||||
|
||||
if ($list) {
|
||||
foreach ($$variable as $index => &$name) {
|
||||
$name .= '|'.$messages[$variable.'_standalone'][$index];
|
||||
$name .= '|'.$list[$index];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$$translationKey = array_merge(
|
||||
$mode & CarbonInterface::TRANSLATE_MONTHS ? static::getTranslationArray($months, static::MONTHS_PER_YEAR, $timeString) : [],
|
||||
$mode & CarbonInterface::TRANSLATE_MONTHS ? static::getTranslationArray($messages['months_short'] ?? [], static::MONTHS_PER_YEAR, $timeString) : [],
|
||||
$mode & CarbonInterface::TRANSLATE_DAYS ? static::getTranslationArray($weekdays, static::DAYS_PER_WEEK, $timeString) : [],
|
||||
$mode & CarbonInterface::TRANSLATE_DAYS ? static::getTranslationArray($messages['weekdays_short'] ?? [], static::DAYS_PER_WEEK, $timeString) : [],
|
||||
$mode & CarbonInterface::TRANSLATE_DIFF ? static::translateWordsByKeys([
|
||||
$mode & CarbonInterface::TRANSLATE_MONTHS ? self::getTranslationArray($months, static::MONTHS_PER_YEAR, $timeString) : [],
|
||||
$mode & CarbonInterface::TRANSLATE_MONTHS ? self::getTranslationArray($messages['months_short'] ?? [], static::MONTHS_PER_YEAR, $timeString) : [],
|
||||
$mode & CarbonInterface::TRANSLATE_DAYS ? self::getTranslationArray($weekdays, static::DAYS_PER_WEEK, $timeString) : [],
|
||||
$mode & CarbonInterface::TRANSLATE_DAYS ? self::getTranslationArray($messages['weekdays_short'] ?? [], static::DAYS_PER_WEEK, $timeString) : [],
|
||||
$mode & CarbonInterface::TRANSLATE_DIFF ? self::translateWordsByKeys([
|
||||
'diff_now',
|
||||
'diff_today',
|
||||
'diff_yesterday',
|
||||
@@ -294,7 +294,7 @@ trait Localization
|
||||
'diff_before_yesterday',
|
||||
'diff_after_tomorrow',
|
||||
], $messages, $key) : [],
|
||||
$mode & CarbonInterface::TRANSLATE_UNITS ? static::translateWordsByKeys([
|
||||
$mode & CarbonInterface::TRANSLATE_UNITS ? self::translateWordsByKeys([
|
||||
'year',
|
||||
'month',
|
||||
'week',
|
||||
@@ -411,10 +411,24 @@ trait Localization
|
||||
|
||||
if ($translator instanceof Translator) {
|
||||
$preferredLocale = $translator->getLocale();
|
||||
$fallbackMessages = [];
|
||||
$preferredMessages = $translator->getMessages($preferredLocale);
|
||||
|
||||
foreach (Translator::get($locale)->getMessages()[$locale] ?? [] as $key => $value) {
|
||||
if (
|
||||
preg_match('/^(?:a_)?(.+)_(?:standalone|ago|from_now|before|after|short|min)$/', $key, $match)
|
||||
&& isset($preferredMessages[$match[1]])
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$fallbackMessages[$key] = $value;
|
||||
}
|
||||
|
||||
$translator->setMessages($preferredLocale, array_replace_recursive(
|
||||
$translator->getMessages()[$locale] ?? [],
|
||||
Translator::get($locale)->getMessages()[$locale] ?? [],
|
||||
$translator->getMessages($preferredLocale),
|
||||
$fallbackMessages,
|
||||
$preferredMessages,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -573,7 +587,7 @@ trait Localization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getAvailableLocales()
|
||||
public static function getAvailableLocales(): array
|
||||
{
|
||||
$translator = static::getLocaleAwareTranslator();
|
||||
|
||||
@@ -588,9 +602,10 @@ trait Localization
|
||||
*
|
||||
* @return Language[]
|
||||
*/
|
||||
public static function getAvailableLocalesInfo()
|
||||
public static function getAvailableLocalesInfo(): array
|
||||
{
|
||||
$languages = [];
|
||||
|
||||
foreach (static::getAvailableLocales() as $id) {
|
||||
$languages[$id] = new Language($id);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ use Generator;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
use ReflectionMethod;
|
||||
use ReflectionNamedType;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
@@ -79,7 +80,7 @@ trait Mixin
|
||||
);
|
||||
|
||||
foreach ($methods as $method) {
|
||||
if ($method->isConstructor() || $method->isDestructor()) {
|
||||
if (self::cannotBeAMixinMethod($method)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -91,6 +92,36 @@ trait Mixin
|
||||
}
|
||||
}
|
||||
|
||||
private static function cannotBeAMixinMethod(ReflectionMethod $method): bool
|
||||
{
|
||||
if ($method->isConstructor() || $method->isDestructor()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$returnType = $method->getReturnType();
|
||||
|
||||
if ($returnType instanceof ReflectionNamedType) {
|
||||
$returnedTypeName = $returnType->getName();
|
||||
|
||||
if ($returnType->isBuiltin()) {
|
||||
return !\in_array($returnedTypeName, [
|
||||
'callable',
|
||||
'object', // could have __invoke
|
||||
'array', // could be [MyClass::class, 'myMethod']
|
||||
'mixed', // could be one of the above
|
||||
// The other builtin types cannot be callable, so we can skip invoking them
|
||||
], true);
|
||||
}
|
||||
|
||||
// If it returns a non-invokable object, it cannot be a mixin method
|
||||
if (class_exists($returnedTypeName)) {
|
||||
return !is_a($returnedTypeName, Closure::class, true) && !\is_callable([$returnedTypeName, '__invoke']);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static function loadMixinTrait(string $trait): void
|
||||
{
|
||||
$context = eval(self::getAnonymousClassCodeForTrait($trait));
|
||||
|
||||
@@ -43,27 +43,22 @@ trait Mutability
|
||||
|
||||
/**
|
||||
* Return a mutable copy of the instance.
|
||||
*
|
||||
* @return Carbon
|
||||
*/
|
||||
public function toMutable()
|
||||
public function toMutable(): Carbon
|
||||
{
|
||||
/** @var Carbon $date */
|
||||
$date = $this->cast(Carbon::class);
|
||||
|
||||
return $date;
|
||||
return $this->cast(Carbon::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a immutable copy of the instance.
|
||||
*
|
||||
* @return CarbonImmutable
|
||||
* Return an immutable copy of the instance.
|
||||
*/
|
||||
public function toImmutable()
|
||||
public function toImmutable(): CarbonImmutable
|
||||
{
|
||||
/** @var CarbonImmutable $date */
|
||||
$date = $this->cast(CarbonImmutable::class);
|
||||
// Immutable objects are fine as is (uncloned)
|
||||
if ($this::class === CarbonImmutable::class) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
return $date;
|
||||
return $this->cast(CarbonImmutable::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,30 +121,9 @@ trait Serialization
|
||||
return static::instance($date);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of properties to dump on serialize() called on.
|
||||
*
|
||||
* Only used by PHP < 7.4.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
{
|
||||
$properties = $this->getSleepProperties();
|
||||
|
||||
if ($this->localTranslator ?? null) {
|
||||
$properties[] = 'dumpLocale';
|
||||
$this->dumpLocale = $this->locale ?? null;
|
||||
}
|
||||
|
||||
return $properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the values to dump on serialize() called on.
|
||||
*
|
||||
* Only used by PHP >= 7.4.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function __serialize(): array
|
||||
@@ -185,41 +164,6 @@ trait Serialization
|
||||
|
||||
/**
|
||||
* Set locale if specified on unserialize() called.
|
||||
*
|
||||
* Only used by PHP < 7.4.
|
||||
*/
|
||||
public function __wakeup(): void
|
||||
{
|
||||
if (parent::class && method_exists(parent::class, '__wakeup')) {
|
||||
// @codeCoverageIgnoreStart
|
||||
try {
|
||||
parent::__wakeup();
|
||||
} catch (Throwable $exception) {
|
||||
try {
|
||||
// FatalError occurs when calling msgpack_unpack() in PHP 7.4 or later.
|
||||
['date' => $date, 'timezone' => $timezone] = $this->dumpDateProperties;
|
||||
parent::__construct($date, $timezone);
|
||||
} catch (Throwable) {
|
||||
throw $exception;
|
||||
}
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
$this->constructedObjectId = spl_object_hash($this);
|
||||
|
||||
if (isset($this->dumpLocale)) {
|
||||
$this->locale($this->dumpLocale);
|
||||
$this->dumpLocale = null;
|
||||
}
|
||||
|
||||
$this->cleanupDumpProperties();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set locale if specified on unserialize() called.
|
||||
*
|
||||
* Only used by PHP >= 7.4.
|
||||
*/
|
||||
public function __unserialize(array $data): void
|
||||
{
|
||||
@@ -297,29 +241,6 @@ trait Serialization
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function getSleepProperties(): array
|
||||
{
|
||||
$properties = $this->dumpProperties;
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
if (!\extension_loaded('msgpack')) {
|
||||
return $properties;
|
||||
}
|
||||
|
||||
if (isset($this->constructedObjectId)) {
|
||||
$timezone = $this->timezone ?? null;
|
||||
$this->dumpDateProperties = [
|
||||
'date' => $this->format('Y-m-d H:i:s.u'),
|
||||
'timezone' => $this->dumpTimezone($timezone),
|
||||
];
|
||||
|
||||
$properties[] = 'dumpDateProperties';
|
||||
}
|
||||
|
||||
return $properties;
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
/** @codeCoverageIgnore */
|
||||
private function dumpTimezone(mixed $timezone): mixed
|
||||
{
|
||||
|
||||
@@ -169,7 +169,7 @@ trait Test
|
||||
: $testInstance->format(static::MOCK_DATETIME_FORMAT);
|
||||
}
|
||||
|
||||
private function getMockedTestNowClone($timezone): CarbonInterface|self|null
|
||||
private static function getMockedTestNowClone($timezone): CarbonInterface|self|null
|
||||
{
|
||||
$mock = static::getMockedTestNow($timezone);
|
||||
|
||||
|
||||
@@ -242,9 +242,9 @@ trait Units
|
||||
* @example $date->add(15, 'days')
|
||||
* @example $date->add(CarbonInterval::days(4))
|
||||
*
|
||||
* @param Unit|string|DateInterval|Closure|CarbonConverterInterface $unit
|
||||
* @param int|float $value
|
||||
* @param bool|null $overflow
|
||||
* @param Unit|int|string|DateInterval|Closure|CarbonConverterInterface $unit
|
||||
* @param Unit|int|float|string $value
|
||||
* @param bool|null $overflow
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
@@ -394,15 +394,18 @@ trait Units
|
||||
* @example $date->sub(15, 'days')
|
||||
* @example $date->sub(CarbonInterval::days(4))
|
||||
*
|
||||
* @param Unit|string|DateInterval|Closure|CarbonConverterInterface $unit
|
||||
* @param int|float $value
|
||||
* @param bool|null $overflow
|
||||
* @param Unit|int|string|DateInterval|Closure|CarbonConverterInterface $unit
|
||||
* @param Unit|int|float|string $value
|
||||
* @param bool|null $overflow
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function sub($unit, $value = 1, ?bool $overflow = null): static
|
||||
{
|
||||
$unit = Unit::toNameIfUnit($unit);
|
||||
$value = Unit::toNameIfUnit($value);
|
||||
|
||||
if (\is_string($unit) && \func_num_args() === 1) {
|
||||
$unit = CarbonInterval::make($unit, [], true);
|
||||
}
|
||||
@@ -437,9 +440,9 @@ trait Units
|
||||
*
|
||||
* @see sub()
|
||||
*
|
||||
* @param string|DateInterval $unit
|
||||
* @param int|float $value
|
||||
* @param bool|null $overflow
|
||||
* @param Unit|int|string|DateInterval $unit
|
||||
* @param Unit|int|float|string $value
|
||||
* @param bool|null $overflow
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user