StateHistoryManager   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A storeHistory() 0 11 1
1
<?php
2
3
namespace Iben\Statable\Services;
4
5
use SM\Event\TransitionEvent;
6
7
class StateHistoryManager
8
{
9
    /**
10
     * @param \SM\Event\TransitionEvent $event
11
     */
12
    public function storeHistory(TransitionEvent $event)
13
    {
14
        $sm = $event->getStateMachine();
15
        $model = $sm->getObject();
16
17
        $model->addHistoryLine([
18
            'transition' => $event->getTransition(),
19
            'from' => $event->getState(),
20
            'to' => $sm->getState(),
21
        ]);
22
    }
23
}
24