Completed
Pull Request — master (#6)
by
unknown
01:35
created

StateHistoryManager   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

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