| Conditions | 4 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 47 | public function validate() |
||
| 48 | { |
||
| 49 | if ($this->path->isDirectory()) { |
||
| 50 | throw new InvalidPathException("Error, can't write file content to a directory."); |
||
| 51 | } |
||
| 52 | |||
| 53 | if (!is_writable($this->path->pathName()) && !$this->isWritable()) { |
||
| 54 | throw new FileSystemException("Error, can't write to the file. The file must be writable."); |
||
| 55 | } |
||
| 56 | } |
||
| 57 | } |
||
| 58 |