Number   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 15
c 2
b 1
f 0
dl 0
loc 54
ccs 0
cts 3
cp 0
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A step() 0 5 1
A getAttributes() 0 7 1
A max() 0 5 1
A min() 0 5 1
1
<?php
2
3
namespace Terranet\Administrator\Field;
4
5
class Number extends Field
6
{
7
    /** @var min|float */
0 ignored issues
show
Bug introduced by
The type Terranet\Administrator\Field\min was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
    protected $min = 0;
9
10
    /** @var null|float */
11
    protected $max = null;
12
13
    /** @var null|double */
14
    protected $step = 1;
15
16
    /**
17
     * @param  float  $min
18
     * @return $this
19
     */
20
    public function min(float $min): self
21
    {
22
        $this->min = $min;
23
24
        return $this;
25
    }
26
27
    /**
28
     * @param  null|float  $max
29
     * @return $this
30
     */
31
    public function max(?float $max): self
32
    {
33
        $this->max = $max;
34
35
        return $this;
36
    }
37
38
    /**
39
     * @param  float  $step
40
     * @return $this
41
     */
42
    public function step(float $step): self
43
    {
44
        $this->step = $step;
45
46
        return $this;
47
    }
48
49
    /**
50
     * @return array
51
     */
52
    public function getAttributes(): array
53
    {
54
        return parent::getAttributes() + [
55
                'min' => $this->min,
56
                'max' => $this->max,
57
                'step' => $this->step,
58
                'style' => 'width: 150px',
59
            ];
60
    }
61
}
62