Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
29 / 29
100.00% covered (success)
100.00%
8 / 8
CRAP
100.00% covered (success)
100.00%
1 / 1
HookRunner
100.00% covered (success)
100.00%
29 / 29
100.00% covered (success)
100.00%
8 / 8
8
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
 onCheckUserFormatRow
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 onCheckUserSubtitleLinks
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 onCheckUserInsertChangesRow
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 onCheckUserInsertLogEventRow
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 onCheckUserInsertPrivateEventRow
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 onCheckUserInsertForRecentChange
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 onSpecialCheckUserGetLinksFromRow
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace MediaWiki\CheckUser\Hook;
4
5use IContextSource;
6use MediaWiki\CheckUser\CheckUser\Pagers\AbstractCheckUserPager;
7use MediaWiki\HookContainer\HookContainer;
8use MediaWiki\User\UserIdentity;
9use RecentChange;
10use stdClass;
11
12class HookRunner implements
13    CheckUserFormatRowHook,
14    CheckUserSubtitleLinksHook,
15    CheckUserInsertChangesRowHook,
16    CheckUserInsertLogEventRowHook,
17    CheckUserInsertPrivateEventRowHook,
18    CheckUserInsertForRecentChangeHook,
19    SpecialCheckUserGetLinksFromRowHook
20{
21
22    private HookContainer $container;
23
24    /**
25     * @param HookContainer $container
26     */
27    public function __construct( HookContainer $container ) {
28        $this->container = $container;
29    }
30
31    /** @inheritDoc */
32    public function onCheckUserFormatRow(
33        IContextSource $context,
34        stdClass $row,
35        array &$rowItems
36    ) {
37        $this->container->run(
38            'CheckUserFormatRow',
39            [ $context, $row, &$rowItems ]
40        );
41    }
42
43    /** @inheritDoc */
44    public function onCheckUserSubtitleLinks(
45        IContextSource $context,
46        array &$links
47    ) {
48        $this->container->run(
49            'CheckUserSubtitleLinks',
50            [ $context, &$links ]
51        );
52    }
53
54    /** @inheritDoc */
55    public function onCheckUserInsertChangesRow(
56        string &$ip, &$xff, array &$row, UserIdentity $user, ?RecentChange $rc
57    ) {
58        $this->container->run(
59            'CheckUserInsertChangesRow',
60            [ &$ip, &$xff, &$row, $user, $rc ]
61        );
62    }
63
64    /** @inheritDoc */
65    public function onCheckUserInsertLogEventRow(
66        string &$ip, &$xff, array &$row, UserIdentity $user, int $id, ?RecentChange $rc
67    ) {
68        $this->container->run(
69            'CheckUserInsertLogEventRow',
70            [ &$ip, &$xff, &$row, $user, $id, $rc ]
71        );
72    }
73
74    /** @inheritDoc */
75    public function onCheckUserInsertPrivateEventRow(
76        string &$ip, &$xff, array &$row, UserIdentity $user, ?RecentChange $rc
77    ) {
78        $this->container->run(
79            'CheckUserInsertPrivateEventRow',
80            [ &$ip, &$xff, &$row, $user, $rc ]
81        );
82    }
83
84    /** @inheritDoc */
85    public function onCheckUserInsertForRecentChange( RecentChange $rc, array &$rcRow ) {
86        $this->container->run(
87            'CheckUserInsertForRecentChange',
88            [ $rc, &$rcRow ]
89        );
90    }
91
92    /** @inheritDoc */
93    public function onSpecialCheckUserGetLinksFromRow(
94        AbstractCheckUserPager $specialCheckUser, stdClass $row, array &$links
95    ) {
96        $this->container->run(
97            'SpecialCheckUserGetLinksFromRow',
98            [ $specialCheckUser, $row, &$links ]
99        );
100    }
101}