Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
12 / 12 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| CommentParserFactory | |
100.00% |
12 / 12 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| create | |
100.00% |
11 / 11 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\CommentFormatter; |
| 4 | |
| 5 | use MediaWiki\Context\RequestContext; |
| 6 | use MediaWiki\FileRepo\RepoGroup; |
| 7 | use MediaWiki\HookContainer\HookContainer; |
| 8 | use MediaWiki\Language\Language; |
| 9 | use MediaWiki\Linker\LinkRenderer; |
| 10 | use MediaWiki\Page\LinkBatchFactory; |
| 11 | use MediaWiki\Page\LinkCache; |
| 12 | use MediaWiki\Title\NamespaceInfo; |
| 13 | use MediaWiki\Title\TitleParser; |
| 14 | |
| 15 | /** |
| 16 | * @internal |
| 17 | */ |
| 18 | class CommentParserFactory { |
| 19 | |
| 20 | public function __construct( |
| 21 | private readonly LinkRenderer $linkRenderer, |
| 22 | private readonly LinkBatchFactory $linkBatchFactory, |
| 23 | private readonly LinkCache $linkCache, |
| 24 | private readonly RepoGroup $repoGroup, |
| 25 | private readonly Language $contLang, |
| 26 | private readonly TitleParser $titleParser, |
| 27 | private readonly NamespaceInfo $namespaceInfo, |
| 28 | private readonly HookContainer $hookContainer |
| 29 | ) { |
| 30 | } |
| 31 | |
| 32 | public function create(): CommentParser { |
| 33 | return new CommentParser( |
| 34 | $this->linkRenderer, |
| 35 | $this->linkBatchFactory, |
| 36 | $this->linkCache, |
| 37 | $this->repoGroup, |
| 38 | RequestContext::getMain()->getLanguage(), |
| 39 | $this->contLang, |
| 40 | $this->titleParser, |
| 41 | $this->namespaceInfo, |
| 42 | $this->hookContainer |
| 43 | ); |
| 44 | } |
| 45 | |
| 46 | } |