EntityEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 29
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setEntity() 0 3 1
A getEntity() 0 3 1
A hasEntity() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\DoctrineEntityRepository\Persistence\Event;
6
7
use Arp\Entity\EntityInterface;
8
9
/**
10
 * @author  Alex Patterson <[email protected]>
11
 * @package Arp\DoctrineEntityRepository\Persistence\Event
12
 */
13
class EntityEvent extends AbstractEntityEvent
14
{
15
    /**
16
     * @var EntityInterface|null
17
     */
18
    private ?EntityInterface $entity = null;
19
20
    /**
21
     * @return bool
22
     */
23
    public function hasEntity(): bool
24
    {
25
        return isset($this->entity);
26
    }
27
28
    /**
29
     * @return EntityInterface|null
30
     */
31
    public function getEntity(): ?EntityInterface
32
    {
33
        return $this->entity;
34
    }
35
36
    /**
37
     * @param EntityInterface|null $entity
38
     */
39
    public function setEntity(?EntityInterface $entity): void
40
    {
41
        $this->entity = $entity;
42
    }
43
}
44