| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | 7 | protected function validatePath($path) |
|
| 14 | { |
||
| 15 | 7 | if (!is_string($path)) { |
|
| 16 | 2 | throw new RuntimeException(sprintf( |
|
| 17 | 2 | '$path must be a string (%s given)', |
|
| 18 | 2 | gettype($path) |
|
| 19 | 2 | )); |
|
| 20 | } |
||
| 21 | |||
| 22 | 5 | if (!file_exists($path)) { |
|
| 23 | 2 | throw new RuntimeException(sprintf( |
|
| 24 | 2 | 'File not found: %s', |
|
| 25 | $path |
||
| 26 | 2 | )); |
|
| 27 | } |
||
| 28 | 3 | } |
|
| 29 | |||
| 36 |