Debian Codegraph @

includes/CommentFormatter/CommentParserFactory.php

raw symbols SCIP
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 * @internal
17 */
18 class CommentParserFactory {
19 /** @var LinkRenderer */
20 private $linkRenderer;
21 /** @var LinkBatchFactory */
22 private $linkBatchFactory;
23 /** @var LinkCache */
24 private $linkCache;
25 /** @var RepoGroup */
26 private $repoGroup;
27 /** @var Language */
28 private $contLang;
29 /** @var TitleParser */
30 private $titleParser;
31 /** @var NamespaceInfo */
32 private $namespaceInfo;
33 /** @var HookContainer */
34 private $hookContainer;
35
36 /**
37 * @param LinkRenderer $linkRenderer
38 * @param LinkBatchFactory $linkBatchFactory
39 * @param LinkCache $linkCache
40 * @param RepoGroup $repoGroup
41 * @param Language $contLang
42 * @param TitleParser $titleParser
43 * @param NamespaceInfo $namespaceInfo
44 * @param HookContainer $hookContainer
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 * @return CommentParser
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 }