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

FieldConfigurationEvent   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
eloc 18
c 1
b 0
f 0
dl 0
loc 55
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getOptions() 0 3 1
A __construct() 0 12 1
A getType() 0 3 1
A getFieldName() 0 3 1
A getContext() 0 3 1
A setType() 0 3 1
A getField() 0 3 1
A setOptions() 0 3 1
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