Passed
Pull Request — master (#19)
by Yannick
02:27
created

TransitionWasFailed::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Star\Component\State\Event;
4
5
use Symfony\Component\EventDispatcher\Event;
6
7
final class TransitionWasFailed extends Event implements StateEvent
8
{
9
    /**
10
     * @var string
11
     */
12
    private $transition;
13
14
    /**
15
     * @var \Exception
16
     */
17
    private $exception;
18
19
    /**
20
     * @param string $transition
21
     * @param \Exception $exception
22
     */
23 11
    public function __construct($transition, \Exception $exception)
24
    {
25 11
        $this->transition = $transition;
26 11
        $this->exception = $exception;
27 11
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function transition()
33
    {
34
        return $this->transition;
35
    }
36
37
    /**
38
     * @return \Exception
39
     */
40
    public function exception()
41
    {
42
        return $this->exception;
43
    }
44
}
45