Test Failed
Push — master ( 99015e...550e97 )
by Bruno
08:43
created

Framework::htmlHead()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 14
rs 10
cc 1
nc 1
nop 1
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\VeeValidate;
4
5
use Formularium\HTMLNode;
6
7
class Framework extends \Formularium\Framework
8
{
9
    public function __construct(string $name = 'VeeValidate')
10
    {
11
        parent::__construct($name);
12
    }
13
14
    public function htmlHead(HTMLNode &$head)
15
    {
16
        $head->appendContent(
17
            [
18
                HTMLNode::factory(
19
                    'script',
20
                    [
21
                        'src' => "https://cdn.jsdelivr.net/npm/vee-validate@<3.0.0/dist/vee-validate.js"
22
                    ]
23
                ),
24
                HTMLNode::factory(
25
                    'script',
26
                    [ ],
27
                    'Vue.component("validation-provider", VeeValidate.ValidationProvider);'
28
                )
29
            ]
30
        );
31
    }
32
33
    public function setImports()
34
    {
35
        /* TODO
36
import * as rules from 'vee-validate/dist/rules';
37
38
Object.keys(rules).forEach(rule => {
39
  extend(rule, rules[rule]);
40
});
41
        */
42
    }
43
}
44