Passed
Push — master ( 7e03c5...6dfa53 )
by Dev
34:30 queued 19:18
created

CrawlerContinue::loadFromPreviousCrawl()   B

Complexity

Conditions 7
Paths 8

Size

Total Lines 27
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 16
CRAP Score 7.0099

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 27
ccs 16
cts 17
cp 0.9412
rs 8.8333
c 0
b 0
f 0
cc 7
nc 8
nop 1
crap 7.0099
1
<?php
2
3
namespace PiedWeb\SeoPocketCrawler;
4
5
class CrawlerContinue extends Crawler
6
{
7
    public function __construct(string $id, ?string $dataDirectory = null)
8
    {
9
        $this->config = CrawlerConfig::loadFrom($id, $dataDirectory);
10 3
11
        $this->recorder = new Recorder($this->config->getDataFolder(), $this->config->getCacheMethod());
12 3
13 3
        $dataFromPreviousCrawl = $this->config->getDataFromPreviousCrawl();
14
15 3
        foreach ($dataFromPreviousCrawl as $k => $v) {
16 3
            $this->$k = $v;
17
        }
18
    }
19
}
20