Conditions | 4 |
Paths | 6 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function generateFile(bool $inVariable = false, bool $global = false):void { |
||
16 | $script = ($inVariable) ? JsUtils::declareVariable("const", $this->varName, $this->generateGlobalScript(), false) : $this->generateGlobalScript().";"; |
||
|
|||
17 | if (!$global){ |
||
18 | \file_put_contents($this->name.".js",$script); |
||
19 | } |
||
20 | elseif(file_exists("components.js")){ |
||
21 | \file_put_contents("components.js",PHP_EOL . $script,FILE_APPEND); |
||
22 | } |
||
23 | else{ |
||
24 | \file_put_contents("components.js",$script); |
||
25 | } |
||
27 | } |