Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 31 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
EventPageDecoratorFactory | |
0.00% |
0 / 31 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
2 | |||
newDecorator | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | declare( strict_types=1 ); |
4 | |
5 | namespace MediaWiki\Extension\CampaignEvents\EventPage; |
6 | |
7 | use MediaWiki\Extension\CampaignEvents\Event\PageEventLookup; |
8 | use MediaWiki\Extension\CampaignEvents\MWEntity\CampaignsCentralUserLookup; |
9 | use MediaWiki\Extension\CampaignEvents\MWEntity\CampaignsPageFactory; |
10 | use MediaWiki\Extension\CampaignEvents\MWEntity\UserLinker; |
11 | use MediaWiki\Extension\CampaignEvents\MWEntity\WikiLookup; |
12 | use MediaWiki\Extension\CampaignEvents\Organizers\OrganizersStore; |
13 | use MediaWiki\Extension\CampaignEvents\Participants\ParticipantsStore; |
14 | use MediaWiki\Extension\CampaignEvents\Permissions\PermissionChecker; |
15 | use MediaWiki\Extension\CampaignEvents\Questions\EventQuestionsRegistry; |
16 | use MediaWiki\Extension\CampaignEvents\Time\EventTimeFormatter; |
17 | use MediaWiki\Language\Language; |
18 | use MediaWiki\Linker\LinkRenderer; |
19 | use MediaWiki\Output\OutputPage; |
20 | use MediaWiki\Permissions\Authority; |
21 | use Wikimedia\Message\IMessageFormatterFactory; |
22 | |
23 | class EventPageDecoratorFactory { |
24 | public const SERVICE_NAME = 'CampaignEventsEventPageDecoratorFactory'; |
25 | |
26 | private PageEventLookup $pageEventLookup; |
27 | private ParticipantsStore $participantsStore; |
28 | private OrganizersStore $organizersStore; |
29 | private PermissionChecker $permissionChecker; |
30 | private IMessageFormatterFactory $messageFormatterFactory; |
31 | private LinkRenderer $linkRenderer; |
32 | private CampaignsPageFactory $campaignsPageFactory; |
33 | private CampaignsCentralUserLookup $centralUserLookup; |
34 | private UserLinker $userLinker; |
35 | private EventTimeFormatter $eventTimeFormatter; |
36 | private EventPageCacheUpdater $eventPageCacheUpdater; |
37 | private EventQuestionsRegistry $eventQuestionsRegistry; |
38 | private WikiLookup $wikiLookup; |
39 | |
40 | /** |
41 | * @param PageEventLookup $pageEventLookup |
42 | * @param ParticipantsStore $participantsStore |
43 | * @param OrganizersStore $organizersStore |
44 | * @param PermissionChecker $permissionChecker |
45 | * @param IMessageFormatterFactory $messageFormatterFactory |
46 | * @param LinkRenderer $linkRenderer |
47 | * @param CampaignsPageFactory $campaignsPageFactory |
48 | * @param CampaignsCentralUserLookup $centralUserLookup |
49 | * @param UserLinker $userLinker |
50 | * @param EventTimeFormatter $eventTimeFormatter |
51 | * @param EventPageCacheUpdater $eventPageCacheUpdater |
52 | * @param EventQuestionsRegistry $eventQuestionsRegistry |
53 | * @param WikiLookup $wikiLookup |
54 | * |
55 | */ |
56 | public function __construct( |
57 | PageEventLookup $pageEventLookup, |
58 | ParticipantsStore $participantsStore, |
59 | OrganizersStore $organizersStore, |
60 | PermissionChecker $permissionChecker, |
61 | IMessageFormatterFactory $messageFormatterFactory, |
62 | LinkRenderer $linkRenderer, |
63 | CampaignsPageFactory $campaignsPageFactory, |
64 | CampaignsCentralUserLookup $centralUserLookup, |
65 | UserLinker $userLinker, |
66 | EventTimeFormatter $eventTimeFormatter, |
67 | EventPageCacheUpdater $eventPageCacheUpdater, |
68 | EventQuestionsRegistry $eventQuestionsRegistry, |
69 | WikiLookup $wikiLookup |
70 | ) { |
71 | $this->pageEventLookup = $pageEventLookup; |
72 | $this->participantsStore = $participantsStore; |
73 | $this->organizersStore = $organizersStore; |
74 | $this->permissionChecker = $permissionChecker; |
75 | $this->messageFormatterFactory = $messageFormatterFactory; |
76 | $this->linkRenderer = $linkRenderer; |
77 | $this->campaignsPageFactory = $campaignsPageFactory; |
78 | $this->centralUserLookup = $centralUserLookup; |
79 | $this->userLinker = $userLinker; |
80 | $this->eventTimeFormatter = $eventTimeFormatter; |
81 | $this->eventPageCacheUpdater = $eventPageCacheUpdater; |
82 | $this->eventQuestionsRegistry = $eventQuestionsRegistry; |
83 | $this->wikiLookup = $wikiLookup; |
84 | } |
85 | |
86 | public function newDecorator( |
87 | Language $language, |
88 | Authority $viewingAuthority, |
89 | OutputPage $out |
90 | ): EventPageDecorator { |
91 | return new EventPageDecorator( |
92 | $this->pageEventLookup, |
93 | $this->participantsStore, |
94 | $this->organizersStore, |
95 | $this->permissionChecker, |
96 | $this->messageFormatterFactory, |
97 | $this->linkRenderer, |
98 | $this->campaignsPageFactory, |
99 | $this->centralUserLookup, |
100 | $this->userLinker, |
101 | $this->eventTimeFormatter, |
102 | $this->eventPageCacheUpdater, |
103 | $this->eventQuestionsRegistry, |
104 | $this->wikiLookup, |
105 | $language, |
106 | $viewingAuthority, |
107 | $out |
108 | ); |
109 | } |
110 | } |