| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | public function write($fileContent) |
||
| 37 | { |
||
| 38 | try { |
||
| 39 | $success = file_put_contents($this->fileName, $fileContent); |
||
| 40 | if (false === $success) { |
||
| 41 | throw new \Exception(); |
||
| 42 | } |
||
| 43 | } catch (\Exception $e) { |
||
| 44 | throw new FileWriterException(sprintf('Cannot write the file at location %s', $this->fileName)); |
||
| 45 | } |
||
| 46 | |||
| 47 | return true; |
||
| 48 | } |
||
| 49 | } |