Skip to content

Conversation

@KuceraMartin
Copy link

Object's state is retrieved in StateMachine::initialize(), therefore $this->setFiniteState has to be called earlier in the constructor

$this->getLoader()->load($this->stateMachine);

$this->setFiniteState($state ?: $this->getInitialState());
$this->onModify();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a little worried about this line - the callback might be using the stateMachine which has not yet been initialized. So maybe this call should be moved to the very end of the constructor? /cc @Mikulas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant