Total Complexity | 8 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 7 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class VueJS extends AbstractVueJS { |
||
16 | |||
17 | protected $useAxios; |
||
18 | |||
19 | protected $configuration; |
||
20 | |||
21 | 9 | public function __construct(string $app = "#app", bool $vuetify = false, bool $useAxios = false) { |
|
29 | 9 | } |
|
30 | |||
31 | 1 | public function __toString(): string { |
|
32 | 1 | $script = ""; |
|
33 | 1 | if ($this->useAxios) { |
|
34 | 1 | $script .= "Vue.prototype.\$http = axios;\n"; |
|
35 | } |
||
36 | 1 | $script .= "const app=new Vue("; |
|
37 | 1 | $script .= JavascriptUtils::arrayToJsObject($this->configuration + $this->data + $this->methods + $this->watchers + $this->computeds + $this->hooks); |
|
38 | 1 | $script = JsUtils::cleanJSONFunctions($script); |
|
39 | 1 | $script .= ")"; |
|
40 | 1 | $script = JavascriptUtils::wrapScript($script); |
|
41 | 1 | return $script; |
|
42 | } |
||
43 | |||
44 | 1 | public function getUseAxios(): bool { |
|
45 | 1 | return $this->useAxios; |
|
46 | } |
||
47 | |||
48 | 2 | public function setUseAxios(bool $useAxios): void { |
|
49 | 2 | $this->useAxios = $useAxios; |
|
50 | 2 | } |
|
51 | |||
52 | 1 | public function getConfiguration(): array { |
|
54 | } |
||
55 | |||
56 | 1 | public function setConfiguration(array $configuration): void { |
|
58 | } |
||
59 | } |