Passed
Push — 1.x ( f66cf3...cff80d )
by Marko
02:21
created

FormField::getPosition()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace KunicMarko\SonataAnnotationBundle\Annotation;
6
7
/**
8
 * @Annotation
9
 * @Target("PROPERTY")
10
 *
11
 * @author Marko Kunic <[email protected]>
12
 */
13
final class FormField extends AbstractField
14
{
15
    public const ACTION_CREATE = 'create';
16
    public const ACTION_EDIT = 'edit';
17
18
    /**
19
     * @var string
20
     */
21
    public $action;
22
23
    /**
24
     * @var array
25
     */
26
    public $options = [];
27
28
    /**
29
     * @var integer
30
     */
31
    public $position;
32
33
    public function getSettings(): array
34
    {
35
        return [
36
            $this->type,
37
            $this->options,
38
            $this->fieldDescriptionOptions
39
        ];
40
    }
41
42
    public function getPosition(): int
43
    {
44
        return $this->position;
45
    }
46
47
    public function hasPosition(): bool
48
    {
49
        return $this->position !== null;
50
    }
51
}
52