Passed
Push — hans/can-you-see-me-now ( 4694a9...8c9aaa )
by Simon
06:23
created

ClearErrorsTask   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 21
ccs 2
cts 2
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 3 1
1
<?php
2
3
4
namespace Firesphere\SolrSearch\Tasks;
5
6
7
use SilverStripe\Dev\BuildTask;
8
use SilverStripe\ORM\DB;
9
10
class ClearErrorsTask extends BuildTask
11
{
12
    /**
13
     * @var string URLSegment
14
     */
15
    private static $segment = 'SolrClearErrorsTask';
1 ignored issue
show
introduced by
The private property $segment is not used, and could be removed.
Loading history...
16
    /**
17
     * @var string Title
18
     */
19
    protected $title = 'Clear out all errors from Solr in the database';
20
    /**
21
     * @var string Description
22
     */
23
    protected $description = 'Remove all errors in the database that are related to Solr indexing/configuring etc.';
24
25
    /**
26
     * @inheritDoc
27
     */
28 1
    public function run($request)
29
    {
30 1
        DB::query('TRUNCATE TABLE `SolrLog`');
31
    }
32
}