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

Object::getAllowedAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 13

Duplication

Lines 18
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 18
loc 18
ccs 0
cts 17
cp 0
rs 9.4285
cc 1
eloc 13
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
 * "object" element
13
 *
14
 * https://html.spec.whatwg.org/multipage/semantics.html#the-object-element
15
 */
16 View Code Duplication
class Object 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
        $objectAllowedAttributes = array(
21
            '/^data$/i' => Element::ATTR_CS_STRING,
22
            '/^type$/i' => Element::ATTR_CS_STRING,
23
            '/^typemustmatch$/i' => Element::ATTR_CS_STRING,
24
            '/^name$/i' => Element::ATTR_CS_STRING,
25
            '/^usemap$/i' => Element::ATTR_CS_STRING,
26
            '/^form$/i' => Element::ATTR_CS_STRING,
27
            '/^width$/i' => Element::ATTR_INT,
28
            '/^height$/i' => Element::ATTR_INT
29
        );
30
31
        return array_merge(
32
            $objectAllowedAttributes,
33
            parent::getAllowedAttributes()
34
        );
35
    }
36
37
    public function isInteractiveContent()
38
    {
39
        return true;
40
    }
41
42
    public function isTransparentElement()
43
    {
44
        return true;
45
    }
46
}
47