Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
33 | public function __construct($filePath) |
||
34 | { |
||
35 | $directoryPath = dirname($filePath); |
||
36 | |||
37 | if (file_exists($directoryPath) === false) { |
||
38 | throw new DirectoryNotFoundException("$directoryPath directory not found"); |
||
39 | } |
||
40 | |||
41 | if (is_writable($directoryPath) === false) { |
||
42 | throw new DirectoryNotWritableException("Can not write to the directory $directoryPath"); |
||
43 | } |
||
44 | |||
45 | $this->file = new SplFileObject($filePath, 'w'); |
||
46 | } |
||
47 | |||
87 |