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

Embed   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 81.82%

Importance

Changes 2
Bugs 1 Features 1
Metric Value
wmc 2
c 2
b 1
f 1
lcom 0
cbo 1
dl 0
loc 22
ccs 9
cts 11
cp 0.8182
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAllowedAttributes() 0 14 1
A isInteractiveContent() 0 4 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