Optgroup   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 5
Bugs 2 Features 0
Metric Value
wmc 3
c 5
b 2
f 0
lcom 0
cbo 1
dl 0
loc 28
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A tagName() 0 4 1
A addChild() 0 4 1
A isValidChild() 0 4 1
1
<?php
2
3
namespace hemio\html;
4
5
/**
6
 * The <code>optgroup</code> element represents a group of option elements with
7
 *  a common label.
8
 *
9
 * @since version 1.0
10
 * @url http://www.w3.org/TR/html5/forms.html#the-optgroup-element
11
 */
12
class Optgroup extends Abstract_\ElementContent implements Interface_\ContentModelSelect
13
{
14
15
    public static function tagName()
16
    {
17
        return 'optgroup';
18
    }
19
20
    /**
21
     *
22
     * @param Option $option
23
     * @return Option
24
     */
25
    public function addChild(Option $option)
26
    {
27
        return $this->addChildInternal($option);
28
    }
29
30
    /**
31
     *
32
     * @param Interface_\HtmlCode $child
33
     * @return boolean
34
     */
35
    public function isValidChild(Interface_\HtmlCode $child)
36
    {
37
        return $child instanceof Option;
38
    }
39
}
40