briannesbitt / Carbon
Showing 30 of 46 files from the diff.

@@ -24,6 +24,9 @@
Loading
24 24
 * - Avtandil Kikabidze (akalongman)
25 25
 * - Levan Velijanashvili (Stichoza)
26 26
 */
27 +
28 +
use Carbon\CarbonInterface;
29 +
27 30
return [
28 31
    'year' => ':count წელი',
29 32
    'y' => ':count წელი',
@@ -149,7 +152,7 @@
Loading
149 152
    'calendar' => [
150 153
        'sameDay' => '[დღეს], LT[-ზე]',
151 154
        'nextDay' => '[ხვალ], LT[-ზე]',
152 -
        'nextWeek' => static function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) {
155 +
        'nextWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) {
153 156
            return ($current->isSameWeek($other) ? '' : '[შემდეგ] ').'dddd, LT[-ზე]';
154 157
        },
155 158
        'lastDay' => '[გუშინ], LT[-ზე]',

@@ -14,6 +14,9 @@
Loading
14 14
 * - Glavić
15 15
 * - Milos Sakovic
16 16
 */
17 +
18 +
use Carbon\CarbonInterface;
19 +
17 20
return [
18 21
    'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
19 22
    'y' => ':count г.',
@@ -60,25 +63,21 @@
Loading
60 63
    'calendar' => [
61 64
        'sameDay' => '[данас у] LT',
62 65
        'nextDay' => '[сутра у] LT',
63 -
        'nextWeek' => static function (\Carbon\CarbonInterface $date) {
64 -
            return match ($date->dayOfWeek) {
65 -
                0 => '[у недељу у] LT',
66 -
                3 => '[у среду у] LT',
67 -
                6 => '[у суботу у] LT',
68 -
                default => '[у] dddd [у] LT',
69 -
            };
66 +
        'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
67 +
            0 => '[у недељу у] LT',
68 +
            3 => '[у среду у] LT',
69 +
            6 => '[у суботу у] LT',
70 +
            default => '[у] dddd [у] LT',
70 71
        },
71 72
        'lastDay' => '[јуче у] LT',
72 -
        'lastWeek' => static function (\Carbon\CarbonInterface $date) {
73 -
            return match ($date->dayOfWeek) {
74 -
                0 => '[прошле недеље у] LT',
75 -
                1 => '[прошлог понедељка у] LT',
76 -
                2 => '[прошлог уторка у] LT',
77 -
                3 => '[прошле среде у] LT',
78 -
                4 => '[прошлог четвртка у] LT',
79 -
                5 => '[прошлог петка у] LT',
80 -
                default => '[прошле суботе у] LT',
81 -
            };
73 +
        'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
74 +
            0 => '[прошле недеље у] LT',
75 +
            1 => '[прошлог понедељка у] LT',
76 +
            2 => '[прошлог уторка у] LT',
77 +
            3 => '[прошле среде у] LT',
78 +
            4 => '[прошлог четвртка у] LT',
79 +
            5 => '[прошлог петка у] LT',
80 +
            default => '[прошле суботе у] LT',
82 81
        },
83 82
        'sameElse' => 'L',
84 83
    ],

@@ -22,6 +22,9 @@
Loading
22 22
 * - Davide Casiraghi (davide-casiraghi)
23 23
 * - Pete Scopes (pdscopes)
24 24
 */
25 +
26 +
use Carbon\CarbonInterface;
27 +
25 28
return [
26 29
    'year' => ':count anno|:count anni',
27 30
    'a_year' => 'un anno|:count anni',
@@ -81,11 +84,9 @@
Loading
81 84
        'nextDay' => '[Domani alle] LT',
82 85
        'nextWeek' => 'dddd [alle] LT',
83 86
        'lastDay' => '[Ieri alle] LT',
84 -
        'lastWeek' => static function (\Carbon\CarbonInterface $date) {
85 -
            return match ($date->dayOfWeek) {
86 -
                0 => '[la scorsa] dddd [alle] LT',
87 -
                default => '[lo scorso] dddd [alle] LT',
88 -
            };
87 +
        'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
88 +
            0 => '[la scorsa] dddd [alle] LT',
89 +
            default => '[lo scorso] dddd [alle] LT',
89 90
        },
90 91
        'sameElse' => 'L',
91 92
    ],

@@ -14,6 +14,7 @@
Loading
14 14
use Carbon\Exceptions\InvalidTimeZoneException;
15 15
use DateTimeInterface;
16 16
use DateTimeZone;
17 +
use Throwable;
17 18
18 19
class CarbonTimeZone extends DateTimeZone
19 20
{
@@ -203,7 +204,7 @@
Loading
203 204
        // @codeCoverageIgnoreStart
204 205
        try {
205 206
            $offset = @$this->getOffset($date) ?: 0;
206 -
        } catch (\Throwable $e) {
207 +
        } catch (Throwable $e) {
207 208
            $offset = 0;
208 209
        }
209 210
        // @codeCoverageIgnoreEnd

@@ -16,6 +16,9 @@
Loading
16 16
 * - dan-nl
17 17
 * - Simon Lelorrain (slelorrain)
18 18
 */
19 +
20 +
use Carbon\CarbonInterface;
21 +
19 22
return [
20 23
    'year' => ':count Joer',
21 24
    'y' => ':countJ',
@@ -57,7 +60,7 @@
Loading
57 60
        'nextDay' => '[Muer um] LT',
58 61
        'nextWeek' => 'dddd [um] LT',
59 62
        'lastDay' => '[Gëschter um] LT',
60 -
        'lastWeek' => static function (\Carbon\CarbonInterface $date) {
63 +
        'lastWeek' => static function (CarbonInterface $date) {
61 64
            // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
62 65
            return match ($date->dayOfWeek) {
63 66
                2, 4 => '[Leschten] dddd [um] LT',

@@ -19,6 +19,9 @@
Loading
19 19
 * - yiannisdesp
20 20
 * - Ilias Kasmeridis (iliaskasm)
21 21
 */
22 +
23 +
use Carbon\CarbonInterface;
24 +
22 25
return [
23 26
    'year' => ':count χρόνος|:count χρόνια',
24 27
    'a_year' => 'ένας χρόνος|:count χρόνια',
@@ -65,11 +68,9 @@
Loading
65 68
        'nextDay' => '[Αύριο {}] LT',
66 69
        'nextWeek' => 'dddd [{}] LT',
67 70
        'lastDay' => '[Χθες {}] LT',
68 -
        'lastWeek' => static function (\Carbon\CarbonInterface $current) {
69 -
            return match ($current->dayOfWeek) {
70 -
                6 => '[το προηγούμενο] dddd [{}] LT',
71 -
                default => '[την προηγούμενη] dddd [{}] LT',
72 -
            };
71 +
        'lastWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) {
72 +
            6 => '[το προηγούμενο] dddd [{}] LT',
73 +
            default => '[την προηγούμενη] dddd [{}] LT',
73 74
        },
74 75
        'sameElse' => 'L',
75 76
    ],

@@ -14,6 +14,9 @@
Loading
14 14
 * - Glavić
15 15
 * - Milos Sakovic
16 16
 */
17 +
18 +
use Carbon\CarbonInterface;
19 +
17 20
return array_replace_recursive(require __DIR__.'/sr.php', [
18 21
    'month' => ':count mjesec|:count mjeseca|:count mjeseci',
19 22
    'week' => ':count nedjelja|:count nedjelje|:count nedjelja',
@@ -27,24 +30,20 @@
Loading
27 30
    'diff_tomorrow' => 'sjutra',
28 31
    'calendar' => [
29 32
        'nextDay' => '[sjutra u] LT',
30 -
        'nextWeek' => static function (\Carbon\CarbonInterface $date) {
31 -
            return match ($date->dayOfWeek) {
32 -
                0 => '[u nedjelju u] LT',
33 -
                3 => '[u srijedu u] LT',
34 -
                6 => '[u subotu u] LT',
35 -
                default => '[u] dddd [u] LT',
36 -
            };
33 +
        'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
34 +
            0 => '[u nedjelju u] LT',
35 +
            3 => '[u srijedu u] LT',
36 +
            6 => '[u subotu u] LT',
37 +
            default => '[u] dddd [u] LT',
37 38
        },
38 -
        'lastWeek' => static function (\Carbon\CarbonInterface $date) {
39 -
            return match ($date->dayOfWeek) {
40 -
                0 => '[prošle nedjelje u] LT',
41 -
                1 => '[prošle nedjelje u] LT',
42 -
                2 => '[prošlog utorka u] LT',
43 -
                3 => '[prošle srijede u] LT',
44 -
                4 => '[prošlog četvrtka u] LT',
45 -
                5 => '[prošlog petka u] LT',
46 -
                default => '[prošle subote u] LT',
47 -
            };
39 +
        'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
40 +
            0 => '[prošle nedjelje u] LT',
41 +
            1 => '[prošle nedjelje u] LT',
42 +
            2 => '[prošlog utorka u] LT',
43 +
            3 => '[prošle srijede u] LT',
44 +
            4 => '[prošlog četvrtka u] LT',
45 +
            5 => '[prošlog petka u] LT',
46 +
            default => '[prošle subote u] LT',
48 47
        },
49 48
    ],
50 49
    'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'],

@@ -19,6 +19,9 @@
Loading
19 19
 * - JD Isaacks
20 20
 * - Tomi Atanasoski
21 21
 */
22 +
23 +
use Carbon\CarbonInterface;
24 +
22 25
return [
23 26
    'year' => ':count година|:count години',
24 27
    'a_year' => 'година|:count години',
@@ -65,11 +68,9 @@
Loading
65 68
        'nextDay' => '[Утре во] LT',
66 69
        'nextWeek' => '[Во] dddd [во] LT',
67 70
        'lastDay' => '[Вчера во] LT',
68 -
        'lastWeek' => static function (\Carbon\CarbonInterface $date) {
69 -
            return match ($date->dayOfWeek) {
70 -
                0, 3, 6 => '[Изминатата] dddd [во] LT',
71 -
                default => '[Изминатиот] dddd [во] LT',
72 -
            };
71 +
        'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
72 +
            0, 3, 6 => '[Изминатата] dddd [во] LT',
73 +
            default => '[Изминатиот] dddd [во] LT',
73 74
        },
74 75
        'sameElse' => 'L',
75 76
    ],

@@ -18,6 +18,9 @@
Loading
18 18
 * - Serhan Apaydın
19 19
 * - JD Isaacks
20 20
 */
21 +
22 +
use Carbon\CarbonInterface;
23 +
21 24
return [
22 25
    'year' => ':count godina|:count godine|:count godina',
23 26
    'y' => ':count godina|:count godine|:count godina',
@@ -55,21 +58,17 @@
Loading
55 58
    'calendar' => [
56 59
        'sameDay' => '[danas u] LT',
57 60
        'nextDay' => '[sutra u] LT',
58 -
        'nextWeek' => static function (\Carbon\CarbonInterface $current) {
59 -
            return match ($current->dayOfWeek) {
60 -
                0 => '[u] [nedjelju] [u] LT',
61 -
                3 => '[u] [srijedu] [u] LT',
62 -
                6 => '[u] [subotu] [u] LT',
63 -
                default => '[u] dddd [u] LT',
64 -
            };
61 +
        'nextWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) {
62 +
            0 => '[u] [nedjelju] [u] LT',
63 +
            3 => '[u] [srijedu] [u] LT',
64 +
            6 => '[u] [subotu] [u] LT',
65 +
            default => '[u] dddd [u] LT',
65 66
        },
66 67
        'lastDay' => '[jučer u] LT',
67 -
        'lastWeek' => static function (\Carbon\CarbonInterface $current) {
68 -
            return match ($current->dayOfWeek) {
69 -
                0, 3 => '[prošlu] dddd [u] LT',
70 -
                6 => '[prošle] [subote] [u] LT',
71 -
                default => '[prošli] dddd [u] LT',
72 -
            };
68 +
        'lastWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) {
69 +
            0, 3 => '[prošlu] dddd [u] LT',
70 +
            6 => '[prošle] [subote] [u] LT',
71 +
            default => '[prošli] dddd [u] LT',
73 72
        },
74 73
        'sameElse' => 'L',
75 74
    ],

@@ -61,8 +61,8 @@
Loading
61 61
     *
62 62
     * /!\ Use this method for unit tests only.
63 63
     *
64 -
     * @param Closure|static|string|false|null $testNow real or mock Carbon instance
65 -
     * @param Closure|null $callback
64 +
     * @param Closure|static|string|false|null $testNow  real or mock Carbon instance
65 +
     * @param Closure|null                     $callback
66 66
     *
67 67
     * @return mixed
68 68
     */

@@ -17,6 +17,9 @@
Loading
17 17
 * - Diego Vilariño
18 18
 * - Sebastian Thierer
19 19
 */
20 +
21 +
use Carbon\CarbonInterface;
22 +
20 23
return [
21 24
    'year' => ':count ano|:count anos',
22 25
    'a_year' => 'un ano|:count anos',
@@ -65,19 +68,19 @@
Loading
65 68
        'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm',
66 69
    ],
67 70
    'calendar' => [
68 -
        'sameDay' => static function (\Carbon\CarbonInterface $current) {
71 +
        'sameDay' => static function (CarbonInterface $current) {
69 72
            return '[hoxe '.($current->hour !== 1 ? 'ás' : 'á').'] LT';
70 73
        },
71 -
        'nextDay' => static function (\Carbon\CarbonInterface $current) {
74 +
        'nextDay' => static function (CarbonInterface $current) {
72 75
            return '[mañá '.($current->hour !== 1 ? 'ás' : 'á').'] LT';
73 76
        },
74 -
        'nextWeek' => static function (\Carbon\CarbonInterface $current) {
77 +
        'nextWeek' => static function (CarbonInterface $current) {
75 78
            return 'dddd ['.($current->hour !== 1 ? 'ás' : 'á').'] LT';
76 79
        },
77 -
        'lastDay' => static function (\Carbon\CarbonInterface $current) {
80 +
        'lastDay' => static function (CarbonInterface $current) {
78 81
            return '[onte '.($current->hour !== 1 ? 'á' : 'a').'] LT';
79 82
        },
80 -
        'lastWeek' => static function (\Carbon\CarbonInterface $current) {
83 +
        'lastWeek' => static function (CarbonInterface $current) {
81 84
            return '[o] dddd [pasado '.($current->hour !== 1 ? 'ás' : 'á').'] LT';
82 85
        },
83 86
        'sameElse' => 'L',

@@ -14,8 +14,10 @@
Loading
14 14
 * - Quentí
15 15
 */
16 16
// @codeCoverageIgnoreStart
17 +
use Symfony\Component\Translation\PluralizationRules;
18 +
17 19
if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) {
18 -
    \Symfony\Component\Translation\PluralizationRules::set(function ($number) {
20 +
    PluralizationRules::set(function ($number) {
19 21
        return $number == 1 ? 0 : 1;
20 22
    }, 'oc');
21 23
}

@@ -92,9 +92,9 @@
Loading
92 92
    }
93 93
94 94
    /**
95 -
     * @param string                                                 $unit microsecond, millisecond, second, minute,
96 -
     *                                                                     hour, day, week, months, quarter, years,
97 -
     *                                                                     century, millennium
95 +
     * @param string                                                 $unit     microsecond, millisecond, second, minute,
96 +
     *                                                                         hour, day, week, months, quarter, years,
97 +
     *                                                                         century, millennium
98 98
     * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date
99 99
     * @param bool                                                   $absolute Get the absolute of the difference
100 100
     *

@@ -35,6 +35,9 @@
Loading
35 35
 * - Vladislav UnsealedOne
36 36
 * - dima-bzz
37 37
 */
38 +
39 +
use Carbon\CarbonInterface;
40 +
38 41
$transformDiff = static fn (string $input) => strtr($input, [
39 42
    'неделя' => 'неделю',
40 43
    'секунда' => 'секунду',
@@ -87,7 +90,7 @@
Loading
87 90
    'calendar' => [
88 91
        'sameDay' => '[Сегодня, в] LT',
89 92
        'nextDay' => '[Завтра, в] LT',
90 -
        'nextWeek' => static function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) {
93 +
        'nextWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) {
91 94
            if ($current->week !== $other->week) {
92 95
                switch ($current->dayOfWeek) {
93 96
                    case 0:
@@ -110,7 +113,7 @@
Loading
110 113
            return '[В] dddd, [в] LT';
111 114
        },
112 115
        'lastDay' => '[Вчера, в] LT',
113 -
        'lastWeek' => static function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) {
116 +
        'lastWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) {
114 117
            if ($current->week !== $other->week) {
115 118
                switch ($current->dayOfWeek) {
116 119
                    case 0:

@@ -27,6 +27,9 @@
Loading
27 27
 * - Daniel Commesse Liévanos (danielcommesse)
28 28
 * - Pete Scopes (pdscopes)
29 29
 */
30 +
31 +
use Carbon\CarbonInterface;
32 +
30 33
return [
31 34
    'year' => ':count año|:count años',
32 35
    'a_year' => 'un año|:count años',
@@ -77,19 +80,19 @@
Loading
77 80
        'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm',
78 81
    ],
79 82
    'calendar' => [
80 -
        'sameDay' => static function (\Carbon\CarbonInterface $current) {
83 +
        'sameDay' => static function (CarbonInterface $current) {
81 84
            return '[hoy a la'.($current->hour !== 1 ? 's' : '').'] LT';
82 85
        },
83 -
        'nextDay' => static function (\Carbon\CarbonInterface $current) {
86 +
        'nextDay' => static function (CarbonInterface $current) {
84 87
            return '[mañana a la'.($current->hour !== 1 ? 's' : '').'] LT';
85 88
        },
86 -
        'nextWeek' => static function (\Carbon\CarbonInterface $current) {
89 +
        'nextWeek' => static function (CarbonInterface $current) {
87 90
            return 'dddd [a la'.($current->hour !== 1 ? 's' : '').'] LT';
88 91
        },
89 -
        'lastDay' => static function (\Carbon\CarbonInterface $current) {
92 +
        'lastDay' => static function (CarbonInterface $current) {
90 93
            return '[ayer a la'.($current->hour !== 1 ? 's' : '').'] LT';
91 94
        },
92 -
        'lastWeek' => static function (\Carbon\CarbonInterface $current) {
95 +
        'lastWeek' => static function (CarbonInterface $current) {
93 96
            return '[el] dddd [pasado a la'.($current->hour !== 1 ? 's' : '').'] LT';
94 97
        },
95 98
        'sameElse' => 'L',

@@ -223,11 +223,11 @@
Loading
223 223
    /**
224 224
     * Translate using translation string or callback available.
225 225
     *
226 -
     * @param string                $key        key to find
227 -
     * @param array                 $parameters replacement parameters
228 -
     * @param string|int|float|null $number     number if plural
229 -
     * @param TranslatorInterface   $translator an optional translator to use
230 -
     * @param bool                  $altNumbers pass true to use alternative numbers
226 +
     * @param string                   $key        key to find
227 +
     * @param array                    $parameters replacement parameters
228 +
     * @param string|int|float|null    $number     number if plural
229 +
     * @param TranslatorInterface|null $translator an optional translator to use
230 +
     * @param bool                     $altNumbers pass true to use alternative numbers
231 231
     *
232 232
     * @return string
233 233
     */

@@ -21,6 +21,9 @@
Loading
21 21
 * - toyama satoshi
22 22
 * - atakigawa
23 23
 */
24 +
25 +
use Carbon\CarbonInterface;
26 +
24 27
return [
25 28
    'year' => ':count年',
26 29
    'y' => ':count年',
@@ -56,7 +59,7 @@
Loading
56 59
    'calendar' => [
57 60
        'sameDay' => '[今日] LT',
58 61
        'nextDay' => '[明日] LT',
59 -
        'nextWeek' => static function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) {
62 +
        'nextWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) {
60 63
            if ($other->week !== $current->week) {
61 64
                return '[来週]dddd LT';
62 65
            }
@@ -64,7 +67,7 @@
Loading
64 67
            return 'dddd LT';
65 68
        },
66 69
        'lastDay' => '[昨日] LT',
67 -
        'lastWeek' => static function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) {
70 +
        'lastWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) {
68 71
            if ($other->week !== $current->week) {
69 72
                return '[先週]dddd LT';
70 73
            }

@@ -20,6 +20,9 @@
Loading
20 20
 * - Nikola Zeravcic
21 21
 * - Milos Sakovic
22 22
 */
23 +
24 +
use Carbon\CarbonInterface;
25 +
23 26
return [
24 27
    'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
25 28
    'y' => ':count г.',
@@ -63,25 +66,21 @@
Loading
63 66
    'calendar' => [
64 67
        'sameDay' => '[данас у] LT',
65 68
        'nextDay' => '[сутра у] LT',
66 -
        'nextWeek' => static function (\Carbon\CarbonInterface $date) {
67 -
            return match ($date->dayOfWeek) {
68 -
                0 => '[у недељу у] LT',
69 -
                3 => '[у среду у] LT',
70 -
                6 => '[у суботу у] LT',
71 -
                default => '[у] dddd [у] LT',
72 -
            };
69 +
        'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
70 +
            0 => '[у недељу у] LT',
71 +
            3 => '[у среду у] LT',
72 +
            6 => '[у суботу у] LT',
73 +
            default => '[у] dddd [у] LT',
73 74
        },
74 75
        'lastDay' => '[јуче у] LT',
75 -
        'lastWeek' => static function (\Carbon\CarbonInterface $date) {
76 -
            return match ($date->dayOfWeek) {
77 -
                0 => '[прошле недеље у] LT',
78 -
                1 => '[прошлог понедељка у] LT',
79 -
                2 => '[прошлог уторка у] LT',
80 -
                3 => '[прошле среде у] LT',
81 -
                4 => '[прошлог четвртка у] LT',
82 -
                5 => '[прошлог петка у] LT',
83 -
                default => '[прошле суботе у] LT',
84 -
            };
76 +
        'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
77 +
            0 => '[прошле недеље у] LT',
78 +
            1 => '[прошлог понедељка у] LT',
79 +
            2 => '[прошлог уторка у] LT',
80 +
            3 => '[прошле среде у] LT',
81 +
            4 => '[прошлог четвртка у] LT',
82 +
            5 => '[прошлог петка у] LT',
83 +
            default => '[прошле суботе у] LT',
85 84
        },
86 85
        'sameElse' => 'L',
87 86
    ],

@@ -27,6 +27,9 @@
Loading
27 27
 * - Jan (aso824)
28 28
 * - diverpl
29 29
 */
30 +
31 +
use Carbon\CarbonInterface;
32 +
30 33
return [
31 34
    'year' => ':count rok|:count lata|:count lat',
32 35
    'a_year' => 'rok|:count lata|:count lat',
@@ -73,23 +76,19 @@
Loading
73 76
    'calendar' => [
74 77
        'sameDay' => '[Dziś o] LT',
75 78
        'nextDay' => '[Jutro o] LT',
76 -
        'nextWeek' => static function (\Carbon\CarbonInterface $date) {
77 -
            return match ($date->dayOfWeek) {
78 -
                0 => '[W niedzielę o] LT',
79 -
                2 => '[We wtorek o] LT',
80 -
                3 => '[W środę o] LT',
81 -
                6 => '[W sobotę o] LT',
82 -
                default => '[W] dddd [o] LT',
83 -
            };
79 +
        'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
80 +
            0 => '[W niedzielę o] LT',
81 +
            2 => '[We wtorek o] LT',
82 +
            3 => '[W środę o] LT',
83 +
            6 => '[W sobotę o] LT',
84 +
            default => '[W] dddd [o] LT',
84 85
        },
85 86
        'lastDay' => '[Wczoraj o] LT',
86 -
        'lastWeek' => static function (\Carbon\CarbonInterface $date) {
87 -
            return match ($date->dayOfWeek) {
88 -
                0 => '[W zeszłą niedzielę o] LT',
89 -
                3 => '[W zeszłą środę o] LT',
90 -
                6 => '[W zeszłą sobotę o] LT',
91 -
                default => '[W zeszły] dddd [o] LT',
92 -
            };
87 +
        'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
88 +
            0 => '[W zeszłą niedzielę o] LT',
89 +
            3 => '[W zeszłą środę o] LT',
90 +
            6 => '[W zeszłą sobotę o] LT',
91 +
            default => '[W zeszły] dddd [o] LT',
93 92
        },
94 93
        'sameElse' => 'L',
95 94
    ],

@@ -17,6 +17,9 @@
Loading
17 17
 * - JD Isaacks
18 18
 * - Glavić
19 19
 */
20 +
21 +
use Carbon\CarbonInterface;
22 +
20 23
return [
21 24
    'year' => ':count година|:count години',
22 25
    'a_year' => 'година|:count години',
@@ -63,11 +66,9 @@
Loading
63 66
        'nextDay' => '[Утре в] LT',
64 67
        'nextWeek' => 'dddd [в] LT',
65 68
        'lastDay' => '[Вчера в] LT',
66 -
        'lastWeek' => static function (\Carbon\CarbonInterface $current) {
67 -
            return match ($current->dayOfWeek) {
68 -
                0, 3, 6 => '[В изминалата] dddd [в] LT',
69 -
                default => '[В изминалия] dddd [в] LT',
70 -
            };
69 +
        'lastWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) {
70 +
            0, 3, 6 => '[В изминалата] dddd [в] LT',
71 +
            default => '[В изминалия] dddd [в] LT',
71 72
        },
72 73
        'sameElse' => 'L',
73 74
    ],

@@ -21,6 +21,9 @@
Loading
21 21
 * - Xavi
22 22
 * - qcardona
23 23
 */
24 +
25 +
use Carbon\CarbonInterface;
26 +
24 27
return [
25 28
    'year' => ':count any|:count anys',
26 29
    'a_year' => 'un any|:count anys',
@@ -69,19 +72,19 @@
Loading
69 72
        'LLLL' => 'dddd D MMMM [de] YYYY [a les] H:mm',
70 73
    ],
71 74
    'calendar' => [
72 -
        'sameDay' => static function (\Carbon\CarbonInterface $current) {
75 +
        'sameDay' => static function (CarbonInterface $current) {
73 76
            return '[avui a '.($current->hour !== 1 ? 'les' : 'la').'] LT';
74 77
        },
75 -
        'nextDay' => static function (\Carbon\CarbonInterface $current) {
78 +
        'nextDay' => static function (CarbonInterface $current) {
76 79
            return '[demà a '.($current->hour !== 1 ? 'les' : 'la').'] LT';
77 80
        },
78 -
        'nextWeek' => static function (\Carbon\CarbonInterface $current) {
81 +
        'nextWeek' => static function (CarbonInterface $current) {
79 82
            return 'dddd [a '.($current->hour !== 1 ? 'les' : 'la').'] LT';
80 83
        },
81 -
        'lastDay' => static function (\Carbon\CarbonInterface $current) {
84 +
        'lastDay' => static function (CarbonInterface $current) {
82 85
            return '[ahir a '.($current->hour !== 1 ? 'les' : 'la').'] LT';
83 86
        },
84 -
        'lastWeek' => static function (\Carbon\CarbonInterface $current) {
87 +
        'lastWeek' => static function (CarbonInterface $current) {
85 88
            return '[el] dddd [passat a '.($current->hour !== 1 ? 'les' : 'la').'] LT';
86 89
        },
87 90
        'sameElse' => 'L',

@@ -29,6 +29,9 @@
Loading
29 29
 * - Lovro Tramšek (Lovro1107)
30 30
 * - burut13
31 31
 */
32 +
33 +
use Carbon\CarbonInterface;
34 +
32 35
return [
33 36
    'year' => ':count leto|:count leti|:count leta|:count let',
34 37
    'y' => ':count leto|:count leti|:count leta|:count let',
@@ -96,7 +99,7 @@
Loading
96 99
        'nextDay' => '[jutri ob] LT',
97 100
        'nextWeek' => 'dddd [ob] LT',
98 101
        'lastDay' => '[včeraj ob] LT',
99 -
        'lastWeek' => static function (\Carbon\CarbonInterface $date) {
102 +
        'lastWeek' => static function (CarbonInterface $date) {
100 103
            switch ($date->dayOfWeek) {
101 104
                case 0:
102 105
                    return '[preteklo] [nedeljo] [ob] LT';

@@ -570,7 +570,7 @@
Loading
570 570
     * @param string      $format   Format of the $interval input string
571 571
     * @param string|null $interval Input string to convert into an interval
572 572
     *
573 -
     * @throws Exception when the $interval cannot be parsed as an interval.
573 +
     * @throws \Carbon\Exceptions\ParseErrorException when the $interval cannot be parsed as an interval.
574 574
     *
575 575
     * @return static
576 576
     */
@@ -1994,8 +1994,8 @@
Loading
1994 1994
    /**
1995 1995
     * Add given parameters to the current interval.
1996 1996
     *
1997 -
     * @param int $years
1998 -
     * @param int $months
1997 +
     * @param int       $years
1998 +
     * @param int       $months
1999 1999
     * @param int|float $weeks
2000 2000
     * @param int|float $days
2001 2001
     * @param int|float $hours
@@ -2024,8 +2024,8 @@
Loading
2024 2024
    /**
2025 2025
     * Add given parameters to the current interval.
2026 2026
     *
2027 -
     * @param int $years
2028 -
     * @param int $months
2027 +
     * @param int       $years
2028 +
     * @param int       $months
2029 2029
     * @param int|float $weeks
2030 2030
     * @param int|float $days
2031 2031
     * @param int|float $hours

@@ -8,7 +8,10 @@
Loading
8 8
 * For the full copyright and license information, please view the LICENSE
9 9
 * file that was distributed with this source code.
10 10
 */
11 -
$processHoursFunction = function (\Carbon\CarbonInterface $date, string $format) {
11 +
12 +
use Carbon\CarbonInterface;
13 +
14 +
$processHoursFunction = static function (CarbonInterface $date, string $format) {
12 15
    return $format.'о'.($date->hour === 11 ? 'б' : '').'] LT';
13 16
};
14 17
@@ -127,40 +130,30 @@
Loading
127 130
        'LLLL' => 'dddd, D MMMM YYYY, HH:mm',
128 131
    ],
129 132
    'calendar' => [
130 -
        'sameDay' => static function (\Carbon\CarbonInterface $date) use ($processHoursFunction) {
131 -
            return $processHoursFunction($date, '[Сьогодні ');
132 -
        },
133 -
        'nextDay' => static function (\Carbon\CarbonInterface $date) use ($processHoursFunction) {
134 -
            return $processHoursFunction($date, '[Завтра ');
135 -
        },
136 -
        'nextWeek' => static function (\Carbon\CarbonInterface $date) use ($processHoursFunction) {
137 -
            return $processHoursFunction($date, '[У] dddd [');
138 -
        },
139 -
        'lastDay' => static function (\Carbon\CarbonInterface $date) use ($processHoursFunction) {
140 -
            return $processHoursFunction($date, '[Вчора ');
141 -
        },
142 -
        'lastWeek' => static function (\Carbon\CarbonInterface $date) use ($processHoursFunction) {
143 -
            return match ($date->dayOfWeek) {
144 -
                0, 3, 5, 6 => $processHoursFunction($date, '[Минулої] dddd ['),
145 -
                default => $processHoursFunction($date, '[Минулого] dddd ['),
146 -
            };
133 +
        'sameDay' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[Сьогодні '),
134 +
        'nextDay' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[Завтра '),
135 +
        'nextWeek' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[У] dddd ['),
136 +
        'lastDay' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[Вчора '),
137 +
        'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
138 +
            0, 3, 5, 6 => $processHoursFunction($date, '[Минулої] dddd ['),
139 +
            default => $processHoursFunction($date, '[Минулого] dddd ['),
147 140
        },
148 141
        'sameElse' => 'L',
149 142
    ],
150 -
    'ordinal' => static function ($number, $period) {
151 -
        return match ($period) {
152 -
            'M', 'd', 'DDD', 'w', 'W' => $number.'-й',
153 -
            'D' => $number.'-го',
154 -
            default => $number,
155 -
        };
143 +
    'ordinal' => static fn ($number, $period) => match ($period) {
144 +
        'M', 'd', 'DDD', 'w', 'W' => $number.'-й',
145 +
        'D' => $number.'-го',
146 +
        default => $number,
156 147
    },
157 148
    'meridiem' => static function ($hour) {
158 149
        if ($hour < 4) {
159 150
            return 'ночі';
160 151
        }
152 +
161 153
        if ($hour < 12) {
162 154
            return 'ранку';
163 155
        }
156 +
164 157
        if ($hour < 17) {
165 158
            return 'дня';
166 159
        }
@@ -171,7 +164,7 @@
Loading
171 164
    'months_standalone' => ['січень', 'лютий', 'березень', 'квітень', 'травень', 'червень', 'липень', 'серпень', 'вересень', 'жовтень', 'листопад', 'грудень'],
172 165
    'months_short' => ['січ', 'лют', 'бер', 'кві', 'тра', 'чер', 'лип', 'сер', 'вер', 'жов', 'лис', 'гру'],
173 166
    'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/',
174 -
    'weekdays' => static function (\Carbon\CarbonInterface $date, $format, $index) {
167 +
    'weekdays' => static function (CarbonInterface $date, $format, $index) {
175 168
        static $words = [
176 169
            'nominative' => ['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'],
177 170
            'accusative' => ['неділю', 'понеділок', 'вівторок', 'середу', 'четвер', 'п’ятницю', 'суботу'],

@@ -15,6 +15,9 @@
Loading
15 15
 * - Brett Johnson
16 16
 * - balping
17 17
 */
18 +
19 +
use Carbon\CarbonInterface;
20 +
18 21
$huWeekEndings = ['vasárnap', 'hétfőn', 'kedden', 'szerdán', 'csütörtökön', 'pénteken', 'szombaton'];
19 22
20 23
return [
@@ -99,11 +102,11 @@
Loading
99 102
    'calendar' => [
100 103
        'sameDay' => '[ma] LT[-kor]',
101 104
        'nextDay' => '[holnap] LT[-kor]',
102 -
        'nextWeek' => static function (\Carbon\CarbonInterface $date) use ($huWeekEndings) {
105 +
        'nextWeek' => static function (CarbonInterface $date) use ($huWeekEndings) {
103 106
            return '['.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]';
104 107
        },
105 108
        'lastDay' => '[tegnap] LT[-kor]',
106 -
        'lastWeek' => static function (\Carbon\CarbonInterface $date) use ($huWeekEndings) {
109 +
        'lastWeek' => static function (CarbonInterface $date) use ($huWeekEndings) {
107 110
            return '[múlt '.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]';
108 111
        },
109 112
        'sameElse' => 'L',

@@ -304,11 +304,13 @@
Loading
304 304
        $date = $date->modify("$value $unit");
305 305
306 306
        if (isset($timeString)) {
307 -
            return $date->setTimeFromTimeString($timeString);
307 +
            $date = $date->setTimeFromTimeString($timeString);
308 +
        } elseif (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) {
309 +
            $date = $date->modify('last day of previous month');
308 310
        }
309 311
310 -
        if (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) {
311 -
            $date = $date->modify('last day of previous month');
312 +
        if (!$date) {
313 +
            throw new UnitException('Unable to add unit '.var_export(\func_get_args(), true));
312 314
        }
313 315
314 316
        return $date;

@@ -19,6 +19,9 @@
Loading
19 19
 * - Glavić
20 20
 * - Milos Sakovic
21 21
 */
22 +
23 +
use Carbon\CarbonInterface;
24 +
22 25
return [
23 26
    'year' => ':count godina|:count godine|:count godina',
24 27
    'y' => ':count g.',
@@ -64,25 +67,21 @@
Loading
64 67
    'calendar' => [
65 68
        'sameDay' => '[danas u] LT',
66 69
        'nextDay' => '[sutra u] LT',
67 -
        'nextWeek' => static function (\Carbon\CarbonInterface $date) {
68 -
            return match ($date->dayOfWeek) {
69 -
                0 => '[u nedelju u] LT',
70 -
                3 => '[u sredu u] LT',
71 -
                6 => '[u subotu u] LT',
72 -
                default => '[u] dddd [u] LT',
73 -
            };
70 +
        'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
71 +
            0 => '[u nedelju u] LT',
72 +
            3 => '[u sredu u] LT',
73 +
            6 => '[u subotu u] LT',
74 +
            default => '[u] dddd [u] LT',
74 75
        },
75 76
        'lastDay' => '[juče u] LT',
76 -
        'lastWeek' => static function (\Carbon\CarbonInterface $date) {
77 -
            return match ($date->dayOfWeek) {
78 -
                0 => '[prošle nedelje u] LT',
79 -
                1 => '[prošlog ponedeljka u] LT',
80 -
                2 => '[prošlog utorka u] LT',
81 -
                3 => '[prošle srede u] LT',
82 -
                4 => '[prošlog četvrtka u] LT',
83 -
                5 => '[prošlog petka u] LT',
84 -
                default => '[prošle subote u] LT',
85 -
            };
77 +
        'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
78 +
            0 => '[prošle nedelje u] LT',
79 +
            1 => '[prošlog ponedeljka u] LT',
80 +
            2 => '[prošlog utorka u] LT',
81 +
            3 => '[prošle srede u] LT',
82 +
            4 => '[prošlog četvrtka u] LT',
83 +
            5 => '[prošlog petka u] LT',
84 +
            default => '[prošle subote u] LT',
86 85
        },
87 86
        'sameElse' => 'L',
88 87
    ],

@@ -9,8 +9,12 @@
Loading
9 9
 * file that was distributed with this source code.
10 10
 */
11 11
// @codeCoverageIgnoreStart
12 +
13 +
use Carbon\CarbonInterface;
14 +
use Symfony\Component\Translation\PluralizationRules;
15 +
12 16
if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) {
13 -
    \Symfony\Component\Translation\PluralizationRules::set(function ($number) {
17 +
    PluralizationRules::set(function ($number) {
14 18
        return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
15 19
    }, 'be');
16 20
}
@@ -113,29 +117,27 @@
Loading
113 117
        'nextDay' => '[Заўтра ў] LT',
114 118
        'nextWeek' => '[У] dddd [ў] LT',
115 119
        'lastDay' => '[Учора ў] LT',
116 -
        'lastWeek' => static function (\Carbon\CarbonInterface $current) {
117 -
            return match ($current->dayOfWeek) {
118 -
                1, 2, 4 => '[У мінулы] dddd [ў] LT',
119 -
                default => '[У мінулую] dddd [ў] LT',
120 -
            };
120 +
        'lastWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) {
121 +
            1, 2, 4 => '[У мінулы] dddd [ў] LT',
122 +
            default => '[У мінулую] dddd [ў] LT',
121 123
        },
122 124
        'sameElse' => 'L',
123 125
    ],
124 -
    'ordinal' => static function ($number, $period) {
125 -
        return match ($period) {
126 -
            'M', 'd', 'DDD', 'w', 'W' => ($number % 10 === 2 || $number % 10 === 3) &&
127 -
                    ($number % 100 !== 12 && $number % 100 !== 13) ? $number.'-і' : $number.'-ы',
128 -
            'D' => $number.'-га',
129 -
            default => $number,
130 -
        };
126 +
    'ordinal' => static fn ($number, $period) => match ($period) {
127 +
        'M', 'd', 'DDD', 'w', 'W' => ($number % 10 === 2 || $number % 10 === 3) &&
128 +
                ($number % 100 !== 12 && $number % 100 !== 13) ? $number.'-і' : $number.'-ы',
129 +
        'D' => $number.'-га',
130 +
        default => $number,
131 131
    },
132 132
    'meridiem' => static function ($hour) {
133 133
        if ($hour < 4) {
134 134
            return 'ночы';
135 135
        }
136 +
136 137
        if ($hour < 12) {
137 138
            return 'раніцы';
138 139
        }
140 +
139 141
        if ($hour < 17) {
140 142
            return 'дня';
141 143
        }

@@ -27,6 +27,9 @@
Loading
27 27
 * - Stjepan Majdak
28 28
 * - Vanja Retkovac (vr00)
29 29
 */
30 +
31 +
use Carbon\CarbonInterface;
32 +
30 33
return [
31 34
    'year' => ':count godinu|:count godine|:count godina',
32 35
    'y' => ':count god.|:count god.|:count god.',
@@ -67,21 +70,17 @@
Loading
67 70
    'calendar' => [
68 71
        'sameDay' => '[danas u] LT',
69 72
        'nextDay' => '[sutra u] LT',
70 -
        'nextWeek' => static function (\Carbon\CarbonInterface $date) {
71 -
            return match ($date->dayOfWeek) {
72 -
                0 => '[u] [nedjelju] [u] LT',
73 -
                3 => '[u] [srijedu] [u] LT',
74 -
                6 => '[u] [subotu] [u] LT',
75 -
                default => '[u] dddd [u] LT',
76 -
            };
73 +
        'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
74 +
            0 => '[u] [nedjelju] [u] LT',
75 +
            3 => '[u] [srijedu] [u] LT',
76 +
            6 => '[u] [subotu] [u] LT',
77 +
            default => '[u] dddd [u] LT',
77 78
        },
78 79
        'lastDay' => '[jučer u] LT',
79 -
        'lastWeek' => static function (\Carbon\CarbonInterface $date) {
80 -
            return match ($date->dayOfWeek) {
81 -
                0, 3 => '[prošlu] dddd [u] LT',
82 -
                6 => '[prošle] [subote] [u] LT',
83 -
                default => '[prošli] dddd [u] LT',
84 -
            };
80 +
        'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
81 +
            0, 3 => '[prošlu] dddd [u] LT',
82 +
            6 => '[prošle] [subote] [u] LT',
83 +
            default => '[prošli] dddd [u] LT',
85 84
        },
86 85
        'sameElse' => 'L',
87 86
    ],

@@ -23,6 +23,9 @@
Loading
23 23
 * - Sebastian Thierer
24 24
 * - Claudson Martins (claudsonm)
25 25
 */
26 +
27 +
use Carbon\CarbonInterface;
28 +
26 29
return [
27 30
    'year' => ':count ano|:count anos',
28 31
    'a_year' => 'um ano|:count anos',
@@ -81,11 +84,9 @@
Loading
81 84
        'nextDay' => '[Amanhã às] LT',
82 85
        'nextWeek' => 'dddd [às] LT',
83 86
        'lastDay' => '[Ontem às] LT',
84 -
        'lastWeek' => static function (\Carbon\CarbonInterface $date) {
85 -
            return match ($date->dayOfWeek) {
86 -
                0, 6 => '[Último] dddd [às] LT',
87 -
                default => '[Última] dddd [às] LT',
88 -
            };
87 +
        'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) {
88 +
            0, 6 => '[Último] dddd [às] LT',
89 +
            default => '[Última] dddd [às] LT',
89 90
        },
90 91
        'sameElse' => 'L',
91 92
    ],
Files Complexity Coverage
src/Carbon 2,056 100.00%
Project Totals (886 files) 2056 100.00%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading