Completed
Push — master ( 0490e0...5154b1 )
by Kevin
03:30
created

Menuitem::getAllowedAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 17
ccs 12
cts 12
cp 1
rs 9.4285
cc 1
eloc 12
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\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 1
    protected function getAllowedAttributes()
18
    {
19
        $menuitemAllowedAttributes = array(
20 1
            '/^type$/i' => Attribute::CI_ENUM . '("","command","checkbox","radio"|"command")',
21 1
            '/^label$/i' => Attribute::CS_STRING,
22 1
            '/^icon$/i' => Attribute::CS_STRING,
23 1
            '/^disabled$/i' => Attribute::BOOL,
24 1
            '/^checked$/i' => Attribute::BOOL,
25 1
            '/^radiogroup$/i' => Attribute::CS_STRING,
26
            '/^default$/i' => Attribute::CS_STRING
27 1
        );
28
29 1
        return array_merge(
30 1
            $menuitemAllowedAttributes,
31 1
            parent::getAllowedAttributes()
32 1
        );
33
    }
34
}
35