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

Iframe::isInteractiveContent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 4
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Groundskeeper\Tokens\Elements;
4
5
use Groundskeeper\Tokens\ElementTypes\EmbeddedContent;
6
use Groundskeeper\Tokens\ElementTypes\FlowContent;
7
use Groundskeeper\Tokens\ElementTypes\InteractiveContent;
8
use Groundskeeper\Tokens\ElementTypes\OpenElement;
9
use Groundskeeper\Tokens\ElementTypes\PhrasingContent;
10
11
/**
12
 * "iframe" element
13
 *
14
 * https://html.spec.whatwg.org/multipage/semantics.html#the-iframe-element
15
 */
16 View Code Duplication
class Iframe extends OpenElement implements FlowContent, PhrasingContent, EmbeddedContent, InteractiveContent
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18
    protected function getAllowedAttributes()
19
    {
20
        $iframeAllowedAttributes = array(
21
            '/^src$/i' => Element::ATTR_URI,
22
            '/^srcdoc$/i' => Element::ATTR_CS_STRING,
23
            '/^name$/i' => Element::ATTR_CS_STRING,
24
            '/^sandbox$/i' => Element::ATTR_CS_STRING,
25
            '/^allowfullscreen$/i' => Element::ATTR_CS_STRING,
26
            '/^width$/i' => Element::ATTR_INT,
27
            '/^height$/i' => Element::ATTR_INT,
28
            '/^referrerpolicy$/i' => Element::ATTR_CS_STRING,
29
        );
30
31
        return array_merge(
32
            $iframeAllowedAttributes,
33
            parent::getAllowedAttributes()
34
        );
35
    }
36
37
    public function isInteractiveContent()
38
    {
39
        return true;
40
    }
41
}
42