Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
ParserDateShort | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
setMsgContent | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | /** |
4 | * @author Doug Wilbourne (dougwilbourne@gmail.com) |
5 | */ |
6 | |
7 | declare(strict_types=1); |
8 | |
9 | namespace pvc\parser\date_time; |
10 | |
11 | use DateTimeZone; |
12 | use IntlDateFormatter; |
13 | use pvc\interfaces\intl\LocaleInterface; |
14 | use pvc\interfaces\msg\MsgInterface; |
15 | use pvc\parser\err\InvalidDateTimeTypeException; |
16 | |
17 | class ParserDateShort extends ParserDateTime |
18 | { |
19 | /** |
20 | * @throws InvalidDateTimeTypeException |
21 | */ |
22 | public function __construct(MsgInterface $msg, LocaleInterface $locale, DateTimeZone $timeZone) |
23 | { |
24 | parent::__construct($msg, $locale, $timeZone); |
25 | parent::setDateType(IntlDateFormatter::SHORT); |
26 | } |
27 | |
28 | |
29 | protected function setMsgContent(MsgInterface $msg): void |
30 | { |
31 | $msgId = 'not_short_date'; |
32 | $msgParameters = []; |
33 | $msg->setContent($this->getMsgDomain(), $msgId, $msgParameters); |
34 | } |
35 | } |