Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
Hooks
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 onParserFirstCallInit
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 onOutputPageParserOutput
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * Graph extension Hooks
4 *
5 * @file
6 * @ingroup Extensions
7 */
8
9namespace Graph;
10
11use MediaWiki\Hook\ParserFirstCallInitHook;
12use MediaWiki\Output\Hook\OutputPageParserOutputHook;
13use MediaWiki\Output\OutputPage;
14use MediaWiki\Parser\Parser;
15use MediaWiki\Parser\ParserOutput;
16
17class Hooks implements
18    ParserFirstCallInitHook,
19    OutputPageParserOutputHook
20{
21
22    /**
23     * ParserFirstCallInit hook handler.
24     * Registers the <graph> tag
25     *
26     * @param Parser $parser
27     */
28    public function onParserFirstCallInit( $parser ) {
29        $parser->setHook( 'graph', [ ParserTag::class, 'onGraphTag' ] );
30    }
31
32    /**
33     * OutputPageParserOutput hook handler
34     * @param OutputPage $outputPage
35     * @param ParserOutput $parserOutput ParserOutput instance being added in $outputPage
36     */
37    public function onOutputPageParserOutput(
38        $outputPage, $parserOutput
39    ): void {
40        ParserTag::finalizeParserOutput( $outputPage, $parserOutput );
41    }
42}