-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove StatefulInterface from type hint #39
Conversation
{ | ||
return $this->getStateMachine($object, $graph)->getCurrentState()->getName(); | ||
} | ||
|
||
/** | ||
* @param StatefulInterface $object | ||
* @param string $graph | ||
* @param object $object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this rather be a common interface? is there any other way to accomplish this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know there is no other way. We can dynamically define under which property path is the state of the object, so it can't be achieved by a static interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there must be a way, cc/ @matthiasnoback
I feel like removing interfaces like this should be thought well
@yohang @cordoval if the passed object is not the good one, then the Factory won't find an associated loader. But as per https://github.com/yohang/Finite/blob/master/src/Finite/Factory/AbstractFactory.php#L33 this won't throw any exception. Maybe we should throw one if |
There is 2 problems here,
In all case, I'll merge this PR as there is no more |
To be fully compliant with the new property access strategy
ping @yohang |
Remove StatefulInterface from type hint
Missed this one, sorry. Merged ;) |
To be fully compliant with the new property access strategy.
Otherwise, I can't use the TwigExtension for example.