Area   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 21
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAllowedAttributes() 0 18 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\FlowContent;
8
use Groundskeeper\Tokens\ElementTypes\PhrasingContent;
9
10
/**
11
 * "area" element
12
 *
13
 * https://html.spec.whatwg.org/multipage/semantics.html#the-area-element
14
 */
15
class Area extends ClosedElement implements FlowContent, PhrasingContent
16
{
17 1
    protected function getAllowedAttributes()
18
    {
19
        $areaAllowedAttributes = array(
20 1
            '/^alt$/i' => Attribute::CS_STRING,
21
            '/^coords$/i' => Attribute::CS_STRING,
22
            '/^shape$/i' => Attribute::CS_STRING,
23
            '/^href$/i' => Attribute::URI,
24
            '/^target$/i' => Attribute::CS_STRING,
25
            '/^download$/i' => Attribute::CS_STRING,
26
            '/^ping$/i' => Attribute::URI,
27
            '/^rel$/i' => Attribute::CS_STRING
28
        );
29
30 1
        return array_merge(
31 1
            $areaAllowedAttributes,
32 1
            parent::getAllowedAttributes()
33
        );
34
    }
35
}
36