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