Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
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 | namespace MediaWiki\Parser; |
| 4 | |
| 5 | use MediaWiki\Language\Language; |
| 6 | |
| 7 | class DateFormatterFactory { |
| 8 | /** @var DateFormatter[] */ |
| 9 | private $instances; |
| 10 | |
| 11 | /** |
| 12 | * @param Language $lang |
| 13 | * @return DateFormatter |
| 14 | */ |
| 15 | public function get( Language $lang ) { |
| 16 | $code = $lang->getCode(); |
| 17 | if ( !isset( $this->instances[$code] ) ) { |
| 18 | $this->instances[$code] = new DateFormatter( $lang ); |
| 19 | } |
| 20 | return $this->instances[$code]; |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | /** @deprecated class alias since 1.43 */ |
| 25 | class_alias( DateFormatterFactory::class, 'DateFormatterFactory' ); |