Embed::isInteractiveContent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
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
            '/^type$/i' => Attribute::CS_STRING,
24
            '/^name$/i' => Attribute::CS_STRING,
25
            '/^[a-z_-]$/i' => Attribute::CS_STRING
26
        );
27
28 1
        return array_merge(
29 1
            $embedAllowedAttributes,
30 1
            parent::getAllowedAttributes()
31
        );
32
    }
33
34 1
    public function isInteractiveContent() : bool
35
    {
36 1
        return true;
37
    }
38
}
39