Completed
Push — master ( e0ac7a...8eddfc )
by Kevin
03:21
created

Script::getAllowedAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 17
ccs 12
cts 12
cp 1
rs 9.4285
cc 1
eloc 12
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Groundskeeper\Tokens\Elements;
4
5
use Groundskeeper\Tokens\Element;
6
use Groundskeeper\Tokens\ElementTypes\FlowContent;
7
use Groundskeeper\Tokens\ElementTypes\MetadataContent;
8
use Groundskeeper\Tokens\ElementTypes\OpenElement;
9
use Groundskeeper\Tokens\ElementTypes\PhrasingContent;
10
use Groundskeeper\Tokens\ElementTypes\ScriptSupporting;
11
12
class Script extends OpenElement implements FlowContent, MetadataContent, PhrasingContent, ScriptSupporting
13
{
14 1
    protected function getAllowedAttributes()
15
    {
16
        $scriptAllowedAttributes = array(
17 1
            '/^src$/i' => Element::ATTR_URI,
18 1
            '/^type$/i' => Element::ATTR_CS_STRING,
19 1
            '/^charset$/i' => Element::ATTR_CS_STRING,
20 1
            '/^async$/i' => Element::ATTR_BOOL,
21 1
            '/^defer$/i' => Element::ATTR_BOOL,
22 1
            '/^crossorigin$/i' => Element::ATTR_CS_STRING,
23
            '/^nonce$/i' => Element::ATTR_CS_STRING
24 1
        );
25
26 1
        return array_merge(
27 1
            $scriptAllowedAttributes,
28 1
            parent::getAllowedAttributes()
29 1
        );
30
    }
31
}
32