Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
HookRunner
100.00% covered (success)
100.00%
5 / 5
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
 onQuizQuestionCreated
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace MediaWiki\Extension\Quiz\Hooks;
4
5use MediaWiki\Extension\Quiz\Question;
6use MediaWiki\Extension\Quiz\Quiz;
7use MediaWiki\HookContainer\HookContainer;
8
9/**
10 * This is a hook runner class, see docs/Hooks.md in core.
11 * @internal
12 */
13class HookRunner implements
14    QuizQuestionCreatedHook
15{
16    private HookContainer $hookContainer;
17
18    public function __construct( HookContainer $hookContainer ) {
19        $this->hookContainer = $hookContainer;
20    }
21
22    /**
23     * @inheritDoc
24     */
25    public function onQuizQuestionCreated( Quiz $quiz, Question &$question ) {
26        return $this->hookContainer->run(
27            'QuizQuestionCreated',
28            [ $quiz, &$question ]
29        );
30    }
31}