Conditions | 4 |
Paths | 6 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function createFile(string $fileName) |
||
10 | { |
||
11 | if (!file_exists(CONFIG_PATH)) { |
||
12 | mkdir(CONFIG_PATH, 0777, true); |
||
13 | } |
||
14 | |||
15 | if (file_exists(CONFIG_PATH . "/" . $fileName . ".php")) { |
||
16 | throw new \Exception("Arquivo ja existe"); |
||
17 | } |
||
18 | $file = fopen(CONFIG_PATH . "/" . $fileName . ".php", 'w+'); |
||
19 | if ($file) { |
||
|
|||
20 | $text = $this->copyFile(); |
||
21 | $lines = $this->modifyClassName($text, $fileName); |
||
22 | fwrite($file, $lines); |
||
23 | fclose($file); |
||
24 | } |
||
41 |