Exemplo n.º 1
0
 /**
  * @param StatemachineInterface $stateMachine
  *
  * @return array
  */
 protected function createLoggerContext(StatemachineInterface $stateMachine)
 {
     $context = array();
     $context[self::CONTEXT_SUBJECT] = $stateMachine->getSubject();
     $context[self::CONTEXT_CURRENT_STATE] = $stateMachine->getCurrentState();
     if ($stateMachine instanceof Statemachine) {
         $context[self::CONTEXT_LAST_STATE] = $stateMachine->getLastState();
         $context[self::CONTEXT_TRANSITION] = $stateMachine->getSelectedTransition();
     }
     return $context;
 }