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

ClearErrorsTask::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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
}