| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 3 | protected function getHarvest(Url $url) |
|
| 23 | { |
||
| 24 | 3 | if (true === $this->fromCache) { |
|
| 25 | 3 | $filePath = $this->recorder->getCacheFilePath($url); |
|
| 26 | 3 | if (file_exists($filePath)) { |
|
| 27 | 2 | $response = new ResponseFromCache( |
|
| 28 | 2 | $filePath, |
|
|
|
|||
| 29 | 2 | $this->base.$url->uri, |
|
| 30 | 2 | json_decode(file_get_contents($filePath.'---info'), true) |
|
| 31 | ); |
||
| 32 | |||
| 33 | 2 | return new Harvest($response); |
|
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | 3 | return parent::getHarvest($url); |
|
| 38 | } |
||
| 40 |