Completed
Push — master ( 91ab9a...64950e )
by Kevin
04:15
created

Area   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 1
Metric Value
wmc 1
c 2
b 1
f 1
lcom 0
cbo 1
dl 0
loc 21
ccs 13
cts 13
cp 1
rs 10

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