UserFormsStepField::FieldHolder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SilverStripe\UserForms\FormField;
4
5
/**
6
 * Represents a page step in a form, which may contain form fields or other groups
7
 */
8
class UserFormsStepField extends UserFormsCompositeField
9
{
10
    private static $casting = [
0 ignored issues
show
introduced by
The private property $casting is not used, and could be removed.
Loading history...
11
        'StepNumber' => 'Int'
12
    ];
13
14
    /**
15
     * Numeric index (1 based) of this step
16
     *
17
     * Null if unassigned
18
     *
19
     * @var int|null
20
     */
21
    protected $number = null;
22
23
    public function FieldHolder($properties = [])
24
    {
25
        return $this->Field($properties);
26
    }
27
28
    /**
29
     * Get the step number
30
     *
31
     * @return int|null
32
     */
33
    public function getStepNumber()
34
    {
35
        return $this->number;
36
    }
37
38
    /**
39
     * Re-assign this step to another number
40
     *
41
     * @param type $number
0 ignored issues
show
Bug introduced by
The type SilverStripe\UserForms\FormField\type 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...
42
     * @return $this
43
     */
44
    public function setStepNumber($number)
45
    {
46
        $this->number = $number;
0 ignored issues
show
Documentation Bug introduced by
It seems like $number of type SilverStripe\UserForms\FormField\type is incompatible with the declared type integer|null of property $number.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
47
        return $this;
48
    }
49
}
50