Passed
Pull Request — master (#3)
by Alex
03:31
created

EntityErrorEvent::setException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\DoctrineEntityRepository\Persistence\Event;
6
7
use Doctrine\ORM\EntityManagerInterface;
8
9
/**
10
 * @author  Alex Patterson <[email protected]>
11
 * @package Arp\DoctrineEntityRepository\Persistence\Event
12
 */
13
class EntityErrorEvent extends AbstractEntityEvent
14
{
15
    /**
16
     * @var \Throwable
17
     */
18
    private $exception;
19
20
    /**
21
     * @param string                 $eventName
22
     * @param string                 $entityName
23
     * @param EntityManagerInterface $entityManager
24
     * @param \Throwable             $exception
25
     * @param array                  $params
26
     */
27
    public function __construct(
28
        string $eventName,
29
        string $entityName,
30
        EntityManagerInterface $entityManager,
31
        \Throwable $exception,
32
        array $params = []
33
    ) {
34
        parent::__construct($eventName, $entityName, $entityManager, $params);
35
36
        $this->exception = $exception;
37
    }
38
39
    /**
40
     * @return \Throwable
41
     */
42
    public function getException(): \Throwable
43
    {
44
        return $this->exception;
45
    }
46
47
    /**
48
     * @param \Throwable $exception
49
     */
50
    public function setException(\Throwable $exception): void
51
    {
52
        $this->exception = $exception;
53
    }
54
}
55