| Conditions | 5 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 55 | 86 | public function setPath($path, $check_writeable = false) |
|
| 56 | { |
||
| 57 | 86 | if (is_null($path)) { |
|
| 58 | 83 | return; |
|
| 59 | } |
||
| 60 | |||
| 61 | 77 | if (!is_dir($path) || ($check_writeable && !is_writable($path))) { |
|
| 62 | 2 | throw new \InvalidArgumentException(sprintf( |
|
| 63 | 2 | "'%s' base path does not exist or is not writable", |
|
| 64 | 2 | $path |
|
| 65 | )); |
||
| 66 | } |
||
| 67 | |||
| 68 | 75 | $this->path = realpath($path); |
|
| 69 | 75 | return $this; |
|
| 70 | } |
||
| 71 | } |
||
| 72 |