Passed
Pull Request — master (#118)
by Nicolaas
02:37 queued 50s
created

DeleteWholeCache   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTitle() 0 3 1
A process() 0 3 1
1
<?php
2
3
namespace SilverStripe\StaticPublishQueue\Job;
4
5
use SilverStripe\StaticPublishQueue\Job;
6
use SilverStripe\StaticPublishQueue\Publisher;
7
8
class DeleteWholeCache extends Job
9
{
10
    /**
11
     * @return string
12
     */
13
    public function getTitle()
14
    {
15
        return 'Remove the entire cache';
16
    }
17
18
    /**
19
     * Do some processing yourself!
20
     */
21
    public function process()
22
    {
23
        $this->isComplete = Publisher::singleton()->purgeAll();
24
    }
25
}
26