Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
ContentTranslationHookRunner
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 onSectionTranslationBeforePublish
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2declare( strict_types = 1 );
3
4namespace ContentTranslation;
5
6use MediaWiki\HookContainer\HookContainer;
7use MediaWiki\Title\Title;
8use MediaWiki\User\User;
9
10class ContentTranslationHookRunner implements SectionTranslationBeforePublishHook {
11
12    public function __construct( private readonly HookContainer $hookContainer ) {
13    }
14
15    /** @inheritDoc */
16    public function onSectionTranslationBeforePublish(
17        Title $title,
18        string $language,
19        User $user
20    ): void {
21        $this->hookContainer->run(
22            'SectionTranslationBeforePublish',
23            [ $title, $language, $user ],
24            [ 'abortable' => false ]
25        );
26    }
27}