File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1515namespace Cake \Chronos ;
1616
1717use DateTime ;
18+ use UnexpectedValueException ;
1819
1920/**
2021 * Provides string formatting methods for datetime instances.
@@ -270,7 +271,8 @@ public function toQuarterRange(): array
270271 1 => [$ year . '-01-01 ' , $ year . '-03-31 ' ],
271272 2 => [$ year . '-04-01 ' , $ year . '-06-30 ' ],
272273 3 => [$ year . '-07-01 ' , $ year . '-09-30 ' ],
273- default => [$ year . '-10-01 ' , $ year . '-12-31 ' ],
274+ 4 => [$ year . '-10-01 ' , $ year . '-12-31 ' ],
275+ default => throw new UnexpectedValueException ('Quarter can only be a value between 1-4 ' ),
274276 };
275277 }
276278
Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ public static function toQuarterRangeProvider()
205205 public function testToQuarterRange ($ date , $ expected )
206206 {
207207 $ this ->assertSame ($ expected , (new Chronos ($ date ))->toQuarterRange ());
208- $ this ->deprecated (function () use ($ date , $ expected ) {
208+ $ this ->deprecated (function () use ($ date , $ expected ) {
209209 $ this ->assertSame ($ expected , (new Chronos ($ date ))->toQuarter (true ));
210210 });
211211 }
You can’t perform that action at this time.
0 commit comments