Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
PurgeOldText
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 execute
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * Purge old text records from the database
4 *
5 * @license GPL-2.0-or-later
6 * @file
7 * @ingroup Maintenance
8 * @author Rob Church <robchur@gmail.com>
9 */
10
11use MediaWiki\Maintenance\Maintenance;
12
13// @codeCoverageIgnoreStart
14require_once __DIR__ . '/Maintenance.php';
15// @codeCoverageIgnoreEnd
16
17/**
18 * Maintenance script that purges old text records from the database.
19 *
20 * @ingroup Maintenance
21 */
22class PurgeOldText extends Maintenance {
23    public function __construct() {
24        parent::__construct();
25        $this->addDescription( 'Purge old text records from the database' );
26        $this->addOption( 'purge', 'Performs the deletion' );
27    }
28
29    public function execute() {
30        $this->purgeRedundantText( $this->hasOption( 'purge' ) );
31    }
32}
33
34// @codeCoverageIgnoreStart
35$maintClass = PurgeOldText::class;
36require_once RUN_MAINTENANCE_IF_MAIN;
37// @codeCoverageIgnoreEnd