StateMachineEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
cbo 1
dl 0
loc 23
c 0
b 0
f 0
ccs 5
cts 5
cp 1
rs 10

2 Methods

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