DatagridField   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 9
dl 0
loc 36
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSettings() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Neimheadh\SonataAnnotationBundle\Annotation;
6
7
/**
8
 * Datagrid field annotation.
9
 *
10
 * Allow you to configure the datagrid for the annotated field.
11
 *
12
 * @Annotation
13
 * @Target("PROPERTY")
14
 *
15
 * @author Marko Kunic <[email protected]>
16
 * @author Mathieu Wambre <[email protected]>
17
 */
18
class DatagridField extends AbstractField implements PositionAnnotationInterface
19
{
20
21
    /**
22
     * Filtering options.
23
     *
24
     * @var array
25
     */
26
    public array $filterOptions = [];
27
28
    /**
29
     * Datagrid form field type options.
30
     *
31
     * @var array
32
     */
33
    public array $fieldOptions = [];
34
35
    /**
36
     * Datagrid field position.
37
     *
38
     * @var int
39
     */
40
    public int $position;
41
42
    /**
43
     * Get field settings.
44
     *
45
     * @return array
46
     */
47
    public function getSettings(): array
48
    {
49
        return [
50
            $this->type ?? null,
51
            $this->filterOptions,
52
            $this->fieldOptions,
53
            $this->fieldDescriptionOptions,
54
        ];
55
    }
56
57
}
58