Object::getAllowedAttributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 13

Duplication

Lines 18
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 18
loc 18
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 13
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\EmbeddedContent;
7
use Groundskeeper\Tokens\ElementTypes\FlowContent;
8
use Groundskeeper\Tokens\ElementTypes\InteractiveContent;
9
use Groundskeeper\Tokens\ElementTypes\OpenElement;
10
use Groundskeeper\Tokens\ElementTypes\PhrasingContent;
11
12
/**
13
 * "object" element
14
 *
15
 * https://html.spec.whatwg.org/multipage/semantics.html#the-object-element
16
 */
17 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...
18
{
19 1
    protected function getAllowedAttributes()
20
    {
21
        $objectAllowedAttributes = array(
22 1
            '/^data$/i' => Attribute::CS_STRING,
23
            '/^type$/i' => Attribute::CS_STRING,
24
            '/^typemustmatch$/i' => Attribute::CS_STRING,
25
            '/^name$/i' => Attribute::CS_STRING,
26
            '/^usemap$/i' => Attribute::CS_STRING,
27
            '/^form$/i' => Attribute::CS_STRING,
28
            '/^width$/i' => Attribute::INT,
29
            '/^height$/i' => Attribute::INT
30
        );
31
32 1
        return array_merge(
33 1
            $objectAllowedAttributes,
34 1
            parent::getAllowedAttributes()
35
        );
36
    }
37
38 1
    public function isInteractiveContent() : bool
39
    {
40 1
        return true;
41
    }
42
43 1
    public function isTransparentElement()
44
    {
45 1
        return true;
46
    }
47
}
48