InputMaskIntegerField   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setValue() 0 3 1
A performReadonlyTransformation() 0 4 1
A __construct() 0 4 1
1
<?php
2
3
namespace LeKoala\FormElements;
4
5
/**
6
 * Format numbers as integers
7
 * "integer": {
8
 * alias: "numeric",
9
 * inputmode: "numeric",
10
 * digits: 0
11
 * },
12
 */
13
class InputMaskIntegerField extends InputMaskNumericField
14
{
15
    public function __construct($name, $title = null, $value = null)
16
    {
17
        parent::__construct($name, $title, $value);
18
        $this->setAlias(self::ALIAS_INTEGER);
19
    }
20
21
    public function setValue($value, $data = null)
22
    {
23
        return parent::setValue($value, $data);
24
    }
25
26
    /**
27
     * Create a new class for this field
28
     */
29
    public function performReadonlyTransformation()
30
    {
31
        $field = $this->castedCopy(NumericReadonlyField::class);
32
        return $field;
33
    }
34
}
35