Both methods exist since the beginning of the project. Only closureToPHP is actually used to generate code in HydratorFactory (documented by #2855).
They add complexity when implementing a new type (see #2868), so types use the ClosureToPHP trait.
Task:
- benchmark performance of removing this methods and always call the type class
- find refactoring optimization
- maybe deprecate this methods