Completed
Push — 1.x ( 815042...ac7482 )
by
unknown
06:00
created

DatagridField   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 13
c 2
b 0
f 0
dl 0
loc 40
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPosition() 0 3 1
A getSettings() 0 8 1
A hasPosition() 0 3 1
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
class DatagridField extends AbstractField
14
{
15
    /**
16
     * @var array
17
     */
18
    public $filterOptions = [];
19
20
    /**
21
     * @var string
22
     */
23
    public $fieldType;
24
25
    /**
26
     * @var array
27
     */
28
    public $fieldOptions = [];
29
30
    /**
31
     * @var int
32
     */
33
    public $position;
34
35
    public function getPosition(): int
36
    {
37
        return $this->position;
38
    }
39
40
    public function hasPosition(): bool
41
    {
42
        return null !== $this->position;
43
    }
44
45
    public function getSettings(): array
46
    {
47
        return [
48
            $this->type,
49
            $this->filterOptions,
50
            $this->fieldType,
51
            $this->fieldOptions,
52
            $this->fieldDescriptionOptions
53
        ];
54
    }
55
}
56