Nip_Form_Renderer_Elements_Dateinput   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
c 2
b 0
f 0
dl 0
loc 21
ccs 0
cts 14
cp 0
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A generateElement() 0 7 2
A getElementAttribs() 0 7 1
1
<?php
2
3
class Nip_Form_Renderer_Elements_Dateinput extends Nip_Form_Renderer_Elements_Input
4
{
5
    public function generateElement()
6
    {
7
        if (!$this->getElement()->getAttrib('id')) {
8
            $this->getElement()->setAttrib('id', $this->getElement()->getJSID());
9
        }
10
        $return = parent::generateElement();
11
        return $return;
12
    }
13
14
    /**
15
     * @return array
16
     */
17
    public function getElementAttribs(): array
18
    {
19
        $attribs = parent::getElementAttribs();
20
        $attribs[] = 'min';
21
        $attribs[] = 'max';
22
23
        return $attribs;
24
    }
25
}
26