Passed
Pull Request — master (#259)
by Arnaud
08:22
created

FieldConfigurationEvent::getOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace LAG\AdminBundle\Event\Events\Configuration;
4
5
use LAG\AdminBundle\Field\FieldInterface;
6
use Symfony\Contracts\EventDispatcher\Event;
7
8
class FieldConfigurationEvent extends Event
9
{
10
    private string $fieldName;
11
    private ?string $type;
12
    private ?FieldInterface $field;
13
    private array $options;
14
    private array $context;
15
16
    public function __construct(
17
        string $fieldName,
18
        string $type = null,
19
        array $options = [],
20
        array $context = [],
21
        FieldInterface $field = null
22
    ) {
23
        $this->fieldName = $fieldName;
24
        $this->type = $type;
25
        $this->field = $field;
26
        $this->options = $options;
27
        $this->context = $context;
28
    }
29
30
    public function setType(string $type): void
31
    {
32
        $this->type = $type;
33
    }
34
35
    public function getType(): ?string
36
    {
37
        return $this->type;
38
    }
39
40
    public function setOptions(array $options): void
41
    {
42
        $this->options = $options;
43
    }
44
45
    public function getOptions(): array
46
    {
47
        return $this->options;
48
    }
49
50
    public function getFieldName(): string
51
    {
52
        return $this->fieldName;
53
    }
54
55
    public function getField(): ?FieldInterface
56
    {
57
        return $this->field;
58
    }
59
60
    public function getContext(): array
61
    {
62
        return $this->context;
63
    }
64
}
65