Conditions | 7 |
Paths | 6 |
Total Lines | 23 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
37 | public function formatSymbol(DateRepresentationInterface $input, FormatToken $token, FormatterInterface $formatter) |
||
38 | { |
||
39 | if (!$input instanceof DateSolarRepresentationInterface) { |
||
40 | return; |
||
41 | } |
||
42 | if ($token->is('y')) { |
||
43 | // y A two digit representation of a year |
||
44 | return $this->converter->to($input->getYear() ?: 0); |
||
45 | } |
||
46 | |||
47 | if ($token->is('Y')) { |
||
48 | // Y A full numeric representation of a year, 4 digits |
||
49 | return sprintf('%04d', $input->getYear()); |
||
50 | } |
||
51 | |||
52 | if ($token->is('L')) { |
||
53 | // L Whether it's a leap year |
||
54 | return (string)(int)$input->isLeapYear(); |
||
55 | } |
||
56 | |||
57 | if ($token->is('z')) { |
||
58 | // z The day of the year (starting from 0) |
||
59 | return (string)$input->getDayIndex(); |
||
60 | } |
||
63 |