You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The func hasStateAccessor() always evaluates to true because the StateMachine constructor inits the stateAccessor to a new PropertyPathStateAccessor...It's never null. So this doesn't work:
if (!$stateMachine->hasStateAccessor()) {
** // I AM NEVER GOING TO LAND HERE.**
$stateMachine->setStateAccessor(new PropertyPathStateAccessor($this->config['property_path']));
}
This wouldn't be a problem, except the StateMachine constructor doesn't pass in a configuration property_path param to the PropertyPathStateAccessor. So the StateAccessor I have is not good. It doesn't ever grab the state.
public function __construct(
$object = null,
EventDispatcherInterface $dispatcher = null,
StateAccessorInterface $stateAccessor = null
) {
$this->object = $object;
$this->dispatcher = $dispatcher ?: new EventDispatcher();
$this->stateAccessor = $stateAccessor ?: new PropertyPathStateAccessor();
}
The text was updated successfully, but these errors were encountered:
Changing stateAccessor in constructor to $this->stateAccessor = $stateAccessor; should propably fix the issue unless there is some reason for initialization in constructor that I am not aware of.
c7a5672
The func hasStateAccessor() always evaluates to true because the StateMachine constructor inits the stateAccessor to a new PropertyPathStateAccessor...It's never null. So this doesn't work:
This wouldn't be a problem, except the StateMachine constructor doesn't pass in a configuration property_path param to the PropertyPathStateAccessor. So the StateAccessor I have is not good. It doesn't ever grab the state.
The text was updated successfully, but these errors were encountered: