Say your end-point middleware action receives input in English unit system (via POST), but all your internal computations are written with the Metric system in mind. So, you need to convert the input into Metric for for the computational engine to work correctly. And the results received from that engine need to be converted back into English system for the view template, to display back to the user.
How would you approach that in Expressive?
This question is probably more of general OO than Expressive but I am curious if Expressive has any provisions for this. Or I wonder if Zend Form has some facilities for this as well.
My naive approach is to create a service that contains conversion methods, and inject that service into my end-point middleware. And I have a choice of either making that service task-specific (convert my business-specific Form data explicitly), or more general (a library of conversion methods to which I pass the values I wish to convert).