Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2.0185 |
Changes | 0 |
1 | <?php |
||
15 | 3 | protected function __construct(string $id) |
|
16 | { |
||
17 | 3 | $this->id = $id; |
|
18 | 3 | $this->dir = __DIR__.'/../data/'.$id.'/links'; |
|
19 | |||
20 | 3 | if (!file_exists($this->dir.'/../config.json')) { |
|
21 | throw new \Exception('no crawl results found for id `'.$id.'`'); |
||
22 | } |
||
23 | 3 | $this->base = json_decode(file_get_contents($this->dir.'/../config.json'), true)['base']; |
|
24 | 3 | } |
|
69 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.