Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 21
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
SpecialEnableEventRegistration
0.00% covered (danger)
0.00%
0 / 21
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 16
0.00% covered (danger)
0.00%
0 / 1
2
 getFormMessages
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
 getValidationFlags
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare( strict_types=1 );
4
5namespace MediaWiki\Extension\CampaignEvents\Special;
6
7use MediaWiki\Extension\CampaignEvents\Event\EditEventCommand;
8use MediaWiki\Extension\CampaignEvents\Event\EventFactory;
9use MediaWiki\Extension\CampaignEvents\Event\Store\IEventLookup;
10use MediaWiki\Extension\CampaignEvents\Hooks\CampaignEventsHookRunner;
11use MediaWiki\Extension\CampaignEvents\MWEntity\CampaignsCentralUserLookup;
12use MediaWiki\Extension\CampaignEvents\MWEntity\PageURLResolver;
13use MediaWiki\Extension\CampaignEvents\MWEntity\WikiLookup;
14use MediaWiki\Extension\CampaignEvents\Organizers\OrganizersStore;
15use MediaWiki\Extension\CampaignEvents\Permissions\PermissionChecker;
16use MediaWiki\Extension\CampaignEvents\PolicyMessagesLookup;
17use MediaWiki\Extension\CampaignEvents\Questions\EventQuestionsRegistry;
18use MediaWiki\Extension\CampaignEvents\TrackingTool\TrackingToolRegistry;
19
20class SpecialEnableEventRegistration extends AbstractEventRegistrationSpecialPage {
21    public const PAGE_NAME = 'EnableEventRegistration';
22
23    public function __construct(
24        IEventLookup $eventLookup,
25        EventFactory $eventFactory,
26        EditEventCommand $editEventCommand,
27        PolicyMessagesLookup $policyMessagesLookup,
28        OrganizersStore $organizersStore,
29        PermissionChecker $permissionChecker,
30        CampaignsCentralUserLookup $centralUserLookup,
31        TrackingToolRegistry $trackingToolRegistry,
32        EventQuestionsRegistry $eventQuestionsRegistry,
33        CampaignEventsHookRunner $hookRunner,
34        PageURLResolver $pageURLResolver,
35        WikiLookup $wikiLookup
36    ) {
37        parent::__construct(
38            self::PAGE_NAME,
39            PermissionChecker::ENABLE_REGISTRATIONS_RIGHT,
40            $eventLookup,
41            $eventFactory,
42            $editEventCommand,
43            $policyMessagesLookup,
44            $organizersStore,
45            $permissionChecker,
46            $centralUserLookup,
47            $trackingToolRegistry,
48            $eventQuestionsRegistry,
49            $hookRunner,
50            $pageURLResolver,
51            $wikiLookup
52        );
53    }
54
55    /**
56     * @inheritDoc
57     */
58    protected function getFormMessages(): array {
59        return [
60            'details-section-subtitle' => 'campaignevents-edit-form-details-subtitle',
61            'submit' => 'campaignevents-enable-registration-form-submit',
62        ];
63    }
64
65    /**
66     * @inheritDoc
67     */
68    protected function getValidationFlags(): int {
69        return EventFactory::VALIDATE_ALL;
70    }
71}