Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3namespace CirrusSearch\Sanity;
4
5use MediaWiki\Title\Title;
6use WikiPage;
7
8/**
9 * Remediation actions for insanity in the search index.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 * http://www.gnu.org/copyleft/gpl.html
25 */
26
27interface Remediator {
28    /**
29     * There is a redirect in the index.
30     * @param WikiPage $page the page in the index
31     */
32    public function redirectInIndex( WikiPage $page );
33
34    /**
35     * A page isn't in the index.
36     * @param WikiPage $page not in the index
37     */
38    public function pageNotInIndex( WikiPage $page );
39
40    /**
41     * A non-existent page is in the index.  Odds are good it was deleted.
42     *
43     * @param string $docId elsaticsearch document id of the deleted page
44     * @param Title $title title of the page read from the ghost
45     */
46    public function ghostPageInIndex( $docId, Title $title );
47
48    /**
49     * An existent page is in more then one index.
50     *
51     * @param string $docId elasticsearch document id
52     * @param WikiPage $page page in too many indexes
53     * @param string $indexSuffix index suffix that the page is in but shouldn't be in
54     */
55    public function pageInWrongIndex( $docId, WikiPage $page, $indexSuffix );
56
57    /**
58     * @param string $docId elasticsearch document id
59     * @param WikiPage $page page with outdated document in index
60     * @param string $indexSuffix index contgaining outdated document
61     */
62    public function oldVersionInIndex( $docId, WikiPage $page, $indexSuffix );
63
64    /**
65     * @param WikiPage $page Page considered too old in index
66     */
67    public function oldDocument( WikiPage $page );
68}