InputMaskIntegerField::setValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 3
rs 10
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