Passed
Push — develop ( ded98c...5fca67 )
by Mathieu
02:55
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
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace KunicMarko\SonataAnnotationBundle\Annotation;
6
7
/**
8
 * Form field annotation.
9
 *
10
 * Allows you to configure form field for the annotated property.
11
 *
12
 * @Annotation
13
 * @Target("PROPERTY")
14
 *
15
 * @author Marko Kunic <[email protected]>
16
 * @author Mathieu Wambre <[email protected]>
17
 */
18
final class FormField extends AbstractField
19
{
20
21
    /**
22
     * Create action name.
23
     */
24
    public const ACTION_CREATE = 'create';
25
26
    /**
27
     * Edit action name.
28
     */
29
    public const ACTION_EDIT = 'edit';
30
31
    /**
32
     * Action name.
33
     *
34
     * @var string
35
     */
36
    public string $action;
37
38
    /**
39
     * Field options.
40
     *
41
     * @var array
42
     */
43
    public array $options = [];
44
45
    /**
46
     * Field position.
47
     *
48
     * @var int
49
     */
50
    public int $position;
51
52
    /**
53
     * Get field form settings.
54
     *
55
     * @return array
56
     */
57
    public function getSettings(): array
58
    {
59
        return [
60
          $this->type ?? null,
61
          $this->options,
62
          $this->fieldDescriptionOptions,
63
        ];
64
    }
65
66
}
67