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

TransitionWasFailed   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
dl 0
loc 36
ccs 4
cts 8
cp 0.5
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A exception() 0 3 1
A transition() 0 3 1
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