Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function write($name, $output) |
||
29 | { |
||
30 | $filePath = sprintf('%s/%s', $this->directory, $name); |
||
31 | |||
32 | if (file_exists($filePath)) { |
||
33 | throw WriterException::fileExistException($filePath); |
||
34 | } |
||
35 | |||
36 | $result = file_put_contents($filePath, $output); |
||
37 | |||
38 | if (false === $result) { |
||
39 | throw WriterException::writeFailureException($filePath); |
||
40 | } |
||
41 | } |
||
42 | } |
||
43 |