StaticSiteCrawlURLsTask   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 13 3
1
<?php
2
3
namespace PhpTek\Exodus\Task;
4
5
use PhpTek\Exodus\Model\StaticSiteContentSource;
6
use SilverStripe\Dev\BuildTask;
7
8
/**
9
 *
10
 * @author Sam Minnee <[email protected]>
11
 * @package phptek/silverstripe-exodus
12
 */
13
class StaticSiteCrawlURLsTask extends BuildTask
14
{
15
    /**
16
     *
17
     * @param HTTPRequest $request
0 ignored issues
show
Bug introduced by
The type PhpTek\Exodus\Task\HTTPRequest was not found. Did you mean HTTPRequest? If so, make sure to prefix the type with \.
Loading history...
18
     * @return null
19
     */
20
    public function run($request)
21
    {
22
        $id = $request->getVar('ID');
23
24
        if (!$id or !is_numeric($id)) {
25
            return null;
26
        }
27
28
        // Find all pages
29
        $contentSource = StaticSiteContentSource::get()->byID($id);
30
        $contentSource->urllist()->crawl(false, true);
31
32
        return null;
33
    }
34
}
35