Skip to content

Commit 8e5d455

Browse files
committed
Fix CS error
1 parent 6c09d96 commit 8e5d455

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/FormattingTrait.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
namespace Cake\Chronos;
1616

1717
use 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

tests/TestCase/DateTime/StringsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)