Passed
Push — master ( 212654...8aa330 )
by Angel Fernando Quiroz
11:04
created

AbstractEvent::setData()   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
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chamilo\CoreBundle\Event;
6
7
use Symfony\Contracts\EventDispatcher\Event;
8
9
abstract class AbstractEvent extends Event
10
{
11
    public const TYPE_NONE = -1;
12
    public const TYPE_PRE = 0;
13
    public const TYPE_POST = 1;
14
    public const TYPE_PRE_POST = 2;
15
16
    public function __construct(
17
        protected array $data = [],
18
        protected int $type = self::TYPE_NONE
19
    ) {}
20
21
    public function getData(): array
22
    {
23
        return $this->data;
24
    }
25
26
    public function setData(array $data): void
27
    {
28
        $this->data = $data;
29
    }
30
31
    public function getType(): int
32
    {
33
        return $this->type;
34
    }
35
}
36