Completed
Push — master ( 9a0898...f1978f )
by Daniel
26s queued 12s
created

DeleteWholeCache   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTitle() 0 3 1
A processUrl() 0 2 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(): string
14
    {
15
        return 'Remove the entire cache';
16
    }
17
18
    /**
19
     * Do some processing yourself!
20
     */
21
    public function process(): void
22
    {
23
        $this->isComplete = Publisher::singleton()->purgeAll();
24
    }
25
26
    public function processUrl(string $url, int $priority): void
27
    {
28
        // noop
29
    }
30
}
31