Open matthewstick opened 3 months ago
In the getState function, sometimes $accessor->getValue can return null.
however, getState is expecting a return type of string, so it breaks the state machine.
If you add a check, this fixes it:
if (is_null($state)) { return ''; }
but maybe there is a better way?
`
public function getState(): string { $accessor = new PropertyAccessor(); $state = $accessor->getValue($this->object, $this->config['property_path']); if ($state instanceof \BackedEnum) { return $state->value; } if ($state instanceof \UnitEnum) { return $state->name; } // possible fix? if (is_null($state)) { return ''; } return $state; }
hi @sebdesign . Tagging in case you didn't see it. This fix is working for me. Hoping not to fork your project, but let me know if this looks legit and you can implement? Thanks!
In the getState function, sometimes $accessor->getValue can return null.
however, getState is expecting a return type of string, so it breaks the state machine.
If you add a check, this fixes it:
if (is_null($state)) { return ''; }
but maybe there is a better way?
`
`