Total Complexity | 5 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 94.12% |
Changes | 8 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class VueJS extends AbstractVueJS { |
||
16 | |||
17 | protected array $configuration; |
||
18 | protected bool $useAxios; |
||
19 | protected string $varName; |
||
20 | |||
21 | 10 | public function __construct(array $configuration = ['el'=>'#app'], string $varName = "app", bool $useAxios = false, bool $useVuetify = false) { |
|
22 | 10 | parent::__construct(); |
|
23 | 10 | $this->useAxios = $useAxios; |
|
24 | 10 | $this->varName = $varName; |
|
25 | 10 | $configuration['el'] = "'". $configuration['el'] ."'"; |
|
26 | 10 | $this->configuration = $configuration; |
|
27 | 10 | if ($useVuetify){ |
|
28 | $this->configuration['vuetify'] = "new Vuetify()"; |
||
29 | } |
||
30 | 10 | } |
|
31 | |||
32 | 1 | protected function generateVueObject(string $object):string { |
|
33 | 1 | $vueObject = "new Vue(".$object.")"; |
|
34 | 1 | return JsUtils::cleanJSONFunctions($vueObject); |
|
35 | } |
||
36 | |||
37 | 1 | public function __toString():string { |
|
42 | } |
||
43 | } |