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
When using a custom property_path (I mean different than "finiteState"), there's a BC break when updating from v1.1.0 to v1.1.1, caused by the commit c7a5672
Before the update, I construct my state machine this way:
$config = /* I get my config array... */
$loader = new ArrayLoader($config);
$stateMachine = new StateMachine($object, $this->eventDispatcher);
$loader->load($stateMachine);
$stateMachine->initialize();
$config['property_path'] is set to a custom path. ArrayLoader::load constructs a PropertyPathStateAccessor with this property. Everything works fine.
After the update to v1.1.1, when I construct my state machine the same way, a default PropertyPathStateAccessor is constructed in ArrayLoader's constructor. So ArrayLoader::load sees that a state accessor is set, so it does not constructs a new one with the configured property path.
So the state machine doesn't have the right property path.
To fix this, I have to change the way I construct my state machine, as follows:
$config = /* I get my config array... */
$loader = new ArrayLoader($config);
$stateMachine = new StateMachine(
$object,
$this->eventDispatcher,
isset($config['property_path']) ? new PropertyPathStateAccessor($config['property_path']) : null
);
$loader->load($stateMachine);
$stateMachine->initialize();
The text was updated successfully, but these errors were encountered:
Since this is not only a BC break, but renders the ArrayLoaders functionality unusable for the property_path, this library should be considered broken and abandon-ware.
Please mark it as such @yohang . There is no shame in it.
Hi,
When using a custom property_path (I mean different than "finiteState"), there's a BC break when updating from v1.1.0 to v1.1.1, caused by the commit c7a5672
Before the update, I construct my state machine this way:
$config['property_path']
is set to a custom path. ArrayLoader::load constructs a PropertyPathStateAccessor with this property. Everything works fine.After the update to v1.1.1, when I construct my state machine the same way, a default PropertyPathStateAccessor is constructed in ArrayLoader's constructor. So ArrayLoader::load sees that a state accessor is set, so it does not constructs a new one with the configured property path.
So the state machine doesn't have the right property path.
To fix this, I have to change the way I construct my state machine, as follows:
The text was updated successfully, but these errors were encountered: