Completed
Push — master ( 559d2f...0490e0 )
by Kevin
03:29
created

Embed::getAllowedAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 14
ccs 9
cts 9
cp 1
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Groundskeeper\Tokens\Elements;
4
5
use Groundskeeper\Tokens\Attribute;
6
use Groundskeeper\Tokens\ElementTypes\ClosedElement;
7
use Groundskeeper\Tokens\ElementTypes\EmbeddedContent;
8
use Groundskeeper\Tokens\ElementTypes\FlowContent;
9
use Groundskeeper\Tokens\ElementTypes\InteractiveContent;
10
use Groundskeeper\Tokens\ElementTypes\PhrasingContent;
11
12
/**
13
 * "embed" element
14
 *
15
 * https://html.spec.whatwg.org/multipage/semantics.html#the-embed-element
16
 */
17
class Embed extends ClosedElement implements FlowContent, PhrasingContent, EmbeddedContent, InteractiveContent
18
{
19 1
    protected function getAllowedAttributes()
20
    {
21
        $embedAllowedAttributes = array(
22 1
            '/^src$/i' => Attribute::URI,
23 1
            '/^type$/i' => Attribute::CS_STRING,
24 1
            '/^name$/i' => Attribute::CS_STRING,
25
            '/^[a-z_-]$/i' => Attribute::CS_STRING
26 1
        );
27
28 1
        return array_merge(
29 1
            $embedAllowedAttributes,
30 1
            parent::getAllowedAttributes()
31 1
        );
32
    }
33
34
    public function isInteractiveContent()
35
    {
36
        return true;
37
    }
38
}
39