Metabor\Statemachine\Statemachine::getCurrentContext PHP Method

getCurrentContext() public method

    public function getCurrentContext()
    {
        return $this->currentContext;
    }

Usage Example

 /**
  * @param \SplSubject|StatemachineInterface|Statemachine $stateMachine
  * @return \ArrayAccess|null
  */
 private function getStateMachineContext($stateMachine)
 {
     $context = null;
     if ($stateMachine instanceof Statemachine) {
         $context = $stateMachine->getCurrentContext();
     }
     return $context;
 }