| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\CommentFormatter; |
| 4 |
|
| 5 |
use MediaWiki\Cache\LinkBatchFactory; |
| 6 |
use MediaWiki\Cache\LinkCache; |
| 7 |
use MediaWiki\Context\RequestContext; |
| 8 |
use MediaWiki\HookContainer\HookContainer; |
| 9 |
use MediaWiki\Language\Language; |
| 10 |
use MediaWiki\Linker\LinkRenderer; |
| 11 |
use MediaWiki\Title\NamespaceInfo; |
| 12 |
use MediaWiki\Title\TitleParser; |
| 13 |
use RepoGroup; |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
class CommentParserFactory { |
| 19 |
|
| 20 |
private $linkRenderer; |
| 21 |
|
| 22 |
private $linkBatchFactory; |
| 23 |
|
| 24 |
private $linkCache; |
| 25 |
|
| 26 |
private $repoGroup; |
| 27 |
|
| 28 |
private $contLang; |
| 29 |
|
| 30 |
private $titleParser; |
| 31 |
|
| 32 |
private $namespaceInfo; |
| 33 |
|
| 34 |
private $hookContainer; |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
public function __construct( |
| 47 |
LinkRenderer $linkRenderer, |
| 48 |
LinkBatchFactory $linkBatchFactory, |
| 49 |
LinkCache $linkCache, |
| 50 |
RepoGroup $repoGroup, |
| 51 |
Language $contLang, |
| 52 |
TitleParser $titleParser, |
| 53 |
NamespaceInfo $namespaceInfo, |
| 54 |
HookContainer $hookContainer |
| 55 |
) { |
| 56 |
$this->linkRenderer = $linkRenderer; |
| 57 |
$this->linkBatchFactory = $linkBatchFactory; |
| 58 |
$this->linkCache = $linkCache; |
| 59 |
$this->repoGroup = $repoGroup; |
| 60 |
$this->contLang = $contLang; |
| 61 |
$this->titleParser = $titleParser; |
| 62 |
$this->namespaceInfo = $namespaceInfo; |
| 63 |
$this->hookContainer = $hookContainer; |
| 64 |
} |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
public function create() { |
| 70 |
return new CommentParser( |
| 71 |
$this->linkRenderer, |
| 72 |
$this->linkBatchFactory, |
| 73 |
$this->linkCache, |
| 74 |
$this->repoGroup, |
| 75 |
RequestContext::getMain()->getLanguage(), |
| 76 |
$this->contLang, |
| 77 |
$this->titleParser, |
| 78 |
$this->namespaceInfo, |
| 79 |
$this->hookContainer |
| 80 |
); |
| 81 |
} |
| 82 |
|
| 83 |
} |