Completed
Push — master ( 6ea55f...555f37 )
by Alfred
01:52
created

Number::__construct()   A

Complexity

Conditions 4
Paths 8

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 14
rs 10
cc 4
nc 8
nop 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: sjhc1170
5
 * Date: 18/05/2018
6
 * Time: 10:00
7
 */
8
9
namespace Iriven\Plugins\Form\Elements;
10
11
12
use \Iriven\Plugins\Form\Core\FormElement;
13
14
class Number extends FormElement
15
{
16
    public function __construct($label, $attributes)
17
    {
18
        parent::__construct($label, $attributes);
19
20
        $this->attributes->set('type','number');
0 ignored issues
show
Bug introduced by
The property attributes is declared private in Iriven\Plugins\Form\Core\FormElement and cannot be accessed from this context.
Loading history...
21
22
        if(!$this->attributes->has('min'))
23
            $this->attributes->set('min','0');
24
25
        if(!$this->attributes->has('max'))
26
            $this->attributes->set('max','100');
27
28
        if(!$this->attributes->has('step'))
29
            $this->attributes->set('step','1');
30
    }
31
32
}