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

Menuitem::getAllowedAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 17
ccs 0
cts 16
cp 0
rs 9.4285
cc 1
eloc 12
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Groundskeeper\Tokens\Elements;
4
5
use Groundskeeper\Tokens\Attribute;
6
use Groundskeeper\Tokens\ElementTypes\OpenElement;
7
8
/**
9
 * "menuitem" element
10
 *
11
 * https://html.spec.whatwg.org/multipage/forms.html#the-menuitem-element
12
 *
13
 * @todo Implement checks.
14
 */
15
class Menuitem extends OpenElement
16
{
17
    protected function getAllowedAttributes()
18
    {
19
        $menuitemAllowedAttributes = array(
20
            '/^type$/i' => Attribute::CI_ENUM . '("","command","checkbox","radio"|"command")',
21
            '/^label$/i' => Attribute::CS_STRING,
22
            '/^icon$/i' => Attribute::CS_STRING,
23
            '/^disabled$/i' => Attribute::BOOL,
24
            '/^checked$/i' => Attribute::BOOL,
25
            '/^radiogroup$/i' => Attribute::CS_STRING,
26
            '/^default$/i' => Attribute::CS_STRING
27
        );
28
29
        return array_merge(
30
            $menuitemAllowedAttributes,
31
            parent::getAllowedAttributes()
32
        );
33
    }
34
}
35