Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
DateFormatterFactory | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
get | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | class DateFormatterFactory { |
4 | /** @var DateFormatter[] */ |
5 | private $instances; |
6 | |
7 | /** |
8 | * @param Language $lang |
9 | * @return DateFormatter |
10 | */ |
11 | public function get( Language $lang ) { |
12 | $code = $lang->getCode(); |
13 | if ( !isset( $this->instances[$code] ) ) { |
14 | $this->instances[$code] = new DateFormatter( $lang ); |
15 | } |
16 | return $this->instances[$code]; |
17 | } |
18 | } |