Conditions | 4 |
Paths | 5 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.0312 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 12 | protected static function decodeYear(\DateTime $value, $count, $locale) |
|
21 | { |
||
22 | switch ($count) { |
||
23 | 12 | case 1: |
|
24 | 10 | return strval(intval($value->format('Y'))); |
|
25 | 2 | case 2: |
|
26 | //return $value->format('y'); |
||
27 | default: |
||
28 | 2 | $s = $value->format('Y'); |
|
29 | 2 | if (!isset($s[$count])) { |
|
30 | $s = str_pad($s, $count, '0', STR_PAD_LEFT); |
||
31 | } |
||
32 | |||
33 | 2 | return $s; |
|
34 | } |
||
35 | } |
||
36 | } |
||
37 |