Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4.25 |
Changes | 0 |
1 | <?php |
||
10 | 7 | public function __construct(string $value) |
|
11 | { |
||
12 | 7 | if (!is_file($value)) { |
|
13 | 2 | throw new \InvalidArgumentException(sprintf('Path "%s" is not a valid file', $value)); |
|
14 | } |
||
15 | |||
16 | 5 | if (!is_readable($value)) { |
|
17 | throw new \InvalidArgumentException(sprintf('File "%s" is not readable', $value)); |
||
18 | } |
||
19 | |||
20 | 5 | if (!is_writable($value)) { |
|
21 | throw new \InvalidArgumentException(sprintf('File "%s" is not writable', $value)); |
||
22 | } |
||
23 | |||
24 | 5 | $this->value = realpath($value); |
|
25 | 5 | } |
|
37 |