/** * Finds the first allowed transition in our array * * @param string $event * @return array */ protected function findFirstAllowedTransition($event, $args) { if ($this->stopped) { return null; } $transitions = $this->transitions->findTransitionsForEventAndState($event, $this->state); foreach ($transitions as $transition) { $handler = $this->factory->createTransitionHandler($transition->handler()); $result = call_user_func_array(array($handler, 'allow'), $this->params($args)); if ($result) { return $transition; } } return null; }
public function test_it_makes_new_class() { $obj = new ObjectFactory('', true); $obj->make('\\StateMachine\\ObjectFactoryTest'); }