Passed
Pull Request — master (#259)
by Arnaud
07:04 queued 03:50
created

FieldEvent   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Test Coverage

Coverage 64.71%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 16
c 1
b 0
f 0
dl 0
loc 45
ccs 11
cts 17
cp 0.6471
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A getFieldName() 0 3 1
A getOptions() 0 3 1
A getType() 0 3 1
A getField() 0 3 1
A getContext() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LAG\AdminBundle\Event\Events;
6
7
use LAG\AdminBundle\Field\FieldInterface;
8
use Symfony\Contracts\EventDispatcher\Event;
9
10
class FieldEvent extends Event
11
{
12
    private string $fieldName;
13
    private ?string $type;
14
    private ?FieldInterface $field;
15
    private array $options;
16
    private array $context;
17
18 7
    public function __construct(
19
        string $fieldName,
20
        string $type = null,
21
        array $options = [],
22
        array $context = [],
23
        FieldInterface $field = null
24
    ) {
25 7
        $this->fieldName = $fieldName;
26 7
        $this->type = $type;
27 7
        $this->field = $field;
28 7
        $this->options = $options;
29 7
        $this->context = $context;
30 7
    }
31
32
    public function getFieldName(): string
33
    {
34
        return $this->fieldName;
35
    }
36
37 7
    public function getType(): ?string
38
    {
39 7
        return $this->type;
40
    }
41
42
    public function getField(): ?FieldInterface
43
    {
44
        return $this->field;
45
    }
46
47 7
    public function getOptions(): array
48
    {
49 7
        return $this->options;
50
    }
51
52
    public function getContext(): array
53
    {
54
        return $this->context;
55
    }
56
}
57