| Conditions | 5 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | 80 | public function setPath($path, $check_writeable = false) |
|
| 40 | { |
||
| 41 | 80 | if (is_null($path)) { |
|
| 42 | 77 | return; |
|
| 43 | } |
||
| 44 | |||
| 45 | 71 | if (!is_dir($path) || ($check_writeable && !is_writable($path))) { |
|
| 46 | 2 | throw new \InvalidArgumentException(sprintf( |
|
| 47 | 2 | "'%s' base path does not exist or is not writable", |
|
| 48 | $path |
||
| 49 | 2 | )); |
|
| 50 | } |
||
| 51 | |||
| 52 | 69 | $this->path = realpath($path); |
|
| 53 | 69 | return $this; |
|
| 54 | } |
||
| 55 | } |