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

Area::getAllowedAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 1

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 18
ccs 13
cts 13
cp 1
rs 9.4285
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\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