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

StateHistoryManager::storeHistory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 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