StateMachineEvent::getStateMachine()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Finite\Event;
4
5
use Finite\StateMachine\StateMachine;
6
use Symfony\Contracts\EventDispatcher\Event;
7
8 5
if (!class_exists('Symfony\Contracts\EventDispatcher\Event')) {
9 5
    class_alias('Symfony\Component\EventDispatcher\Event', 'Symfony\Contracts\EventDispatcher\Event');
10 3
}
11
12
/**
13
 * The event object which is thrown on state machine actions.
14
 *
15
 * @author Yohan Giarelli <[email protected]>
16
 */
17
class StateMachineEvent extends Event
18
{
19
    /**
20
     * @var StateMachine
21
     */
22
    protected $stateMachine;
23
24
    /**
25
     * @param StateMachine $stateMachine
26
     */
27 185
    public function __construct(StateMachine $stateMachine)
28
    {
29 185
        $this->stateMachine = $stateMachine;
30 185
    }
31
32
    /**
33
     * @return StateMachine
34
     */
35 20
    public function getStateMachine()
36
    {
37 20
        return $this->stateMachine;
38
    }
39
}
40