Metabor\Statemachine\Factory\StatefulStateNameDetector::detectCurrentStateName PHP Method

detectCurrentStateName() public method

See also: MetaborStd\Statemachine\Factory\StateNameDetectorInterface::detectCurrentStateName()
public detectCurrentStateName ( $subject )
    public function detectCurrentStateName($subject)
    {
        if ($subject instanceof StatefulInterface) {
            return $subject->getCurrentStateName();
        } else {
            throw new \InvalidArgumentException('Subject has to implement the StatefulInterface!');
        }
    }
StatefulStateNameDetector