| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 1 | public static function exec(FilesystemInterface $vfs, string $id, string $content = '', array $attributes = []) |
|
| 23 | { |
||
| 24 | 1 | if (Exist::exec($vfs, $id)) { |
|
| 25 | 1 | throw new \Exception('File already exist.'); |
|
| 26 | } |
||
| 27 | |||
| 28 | 1 | $file = File::create($id, $content, $attributes); |
|
| 29 | |||
| 30 | 1 | $vfs->getCwd()->add($file); |
|
| 31 | |||
| 32 | 1 | return $file; |
|
| 33 | } |
||
| 35 |