Passed
Push — master ( 463945...c0e83c )
by Bruno
08:14
created

Framework::htmlHead()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 15
ccs 0
cts 15
cp 0
crap 2
rs 9.9666
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\Quill;
4
5
use Formularium\HTMLElement;
6
7
class Framework extends \Formularium\Framework
8
{
9
    /**
10
     * Support for Quill editor on html editors
11
     *
12
     * https://quilljs.com/docs/quickstart/
13
     *
14
     * @param string $name
15
     */
16
    public function __construct(string $name = 'Quill')
17
    {
18
        parent::__construct($name);
19
    }
20
21
    public function htmlHead(HTMLElement &$head)
22
    {
23
        $head->appendContent(
24
            HTMLElement::factory(
25
                'script',
26
                [
27
                    'src' => "https://cdn.quilljs.com/1.3.6/quill.min.js"
28
                ]
29
            )
30
        )->appendContent(
31
            HTMLElement::factory(
32
                'link',
33
                [
34
                    'rel' => "stylesheet",
35
                    'href' => "https://cdn.quilljs.com/1.3.6/quill.snow.css"
36
                    ]
37
            )
38
        );
39
    }
40
}
41