Hello,
The provided StateResolvers like https://github.com/Sylius/Sylius/blob/master/src/Sylius/Component/Core/StateResolver/OrderPaymentStateResolver.php have only private and public properties and methods.
This make more difficult to extend them as you almost need to duplicate all code in the classes. And extending this is probably needed if you add more states in place.
I suggest to change those private to protected. 驴Thoughts?
The class is quite small and if you customize the logic here, I think it is reasonable to simply implement your own state resolver. This way the logic is visible and not hidden in some protected methods, etc. Let's see what others say.
We can also make this class final. It would be an easier :)
well, as @pjedrzejewski says is easy to add my own and override service to use my class instead. Ok to the final proposal then too :)
@pjedrzejewski @lchrusciel WDYT if apart from making the class final we inject a PaymentTargetTransitionResolverInterface to the class and we remove the protected methods?Easier to test, easier to mantain, easier to reuse
@gorkalaucirica IMHO we should make state resolvers private _final_ anyway. But extracting this logic is also a good idea :)
@lchrusciel Yes, I aggree in making them final