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

FieldEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 5
dl 0
loc 12
ccs 6
cts 6
cp 1
crap 1
rs 10
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