Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4.0582 |
Changes | 5 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | 1 | public function __toString(): string { |
|
32 | 1 | $script = ""; |
|
33 | 1 | if(!empty(AbstractVueJS::$global)){ |
|
34 | foreach(AbstractVueJS::$global as $global){ |
||
35 | $script .= $global."\n"; |
||
36 | } |
||
37 | } |
||
38 | 1 | if ($this->useAxios) { |
|
39 | 1 | $script .= "Vue.prototype.\$http = axios;\n"; |
|
40 | } |
||
41 | 1 | $script .= "const app=new Vue("; |
|
42 | 1 | $script .= JavascriptUtils::arrayToJsObject($this->configuration + $this->data + $this->methods + $this->watchers + $this->filters + $this->computeds + $this->hooks); |
|
43 | 1 | $script = JsUtils::cleanJSONFunctions($script); |
|
44 | 1 | $script .= ")"; |
|
45 | 1 | $script = JavascriptUtils::wrapScript($script); |
|
46 | 1 | return $script; |
|
47 | } |
||
64 | } |