Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
AdminLinksHooks
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
12
0.00% covered (danger)
0.00%
0 / 1
 onAdminLinks
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
12
1<?php
2
3namespace MediaWiki\Extension\ReplaceText;
4
5use AdminLinksHook;
6use ALItem;
7use ALRow;
8use ALTree;
9
10class AdminLinksHooks implements AdminLinksHook {
11
12    /**
13     * Implements AdminLinks hook from Extension:Admin_Links.
14     *
15     * @param ALTree &$adminLinksTree
16     */
17    public function onAdminLinks( ALTree &$adminLinksTree ) {
18        $generalSection = $adminLinksTree->getSection( wfMessage( 'adminlinks_general' )->text() );
19
20        if ( !$generalSection ) {
21            return;
22        }
23        $extensionsRow = $generalSection->getRow( 'extensions' );
24
25        if ( $extensionsRow === null ) {
26            $extensionsRow = new ALRow( 'extensions' );
27            $generalSection->addRow( $extensionsRow );
28        }
29
30        $extensionsRow->addItem( ALItem::newFromSpecialPage( 'ReplaceText' ) );
31    }
32}