| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Way\Generators; |
||
| 17 | public function make(string $templatePath, array $templateData, string $filePathToGenerate) |
||
| 18 | { |
||
| 19 | // We first need to compile the template, |
||
| 20 | // according to the data that we provide. |
||
| 21 | $template = $this->compile($templatePath, $templateData, new TemplateCompiler); |
||
| 22 | |||
| 23 | // Now that we have the compiled template, |
||
| 24 | // we can actually generate the file. |
||
| 25 | if (File::exists($filePathToGenerate)) { |
||
| 26 | throw new FileExistsException(); |
||
| 27 | } |
||
| 28 | |||
| 29 | File::put($filePathToGenerate, $template); |
||
| 30 | } |
||
| 45 |