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

TransitionWasSuccessful   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A transition() 0 3 1
1
<?php
2
/**
3
 * This file is part of the php-state project.
4
 *
5
 * (c) Yannick Voyer <[email protected]> (http://github.com/yvoyer)
6
 */
7
8
namespace Star\Component\State\Event;
9
10
use Symfony\Component\EventDispatcher\Event;
11
use Webmozart\Assert\Assert;
12
13
final class TransitionWasSuccessful extends Event implements StateEvent
14
{
15
    /**
16
     * @var string
17
     */
18
    private $transition;
19
20
    /**
21
     * @param string $transition
22
     */
23 19
    public function __construct($transition)
24
    {
25 19
        Assert::string($transition);
26 19
        $this->transition = $transition;
27 19
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function transition()
33
    {
34
        return $this->transition;
35
    }
36
}
37