The min and max methods can take a list of items of any type and return correct item. Currently the _minMax method uses the check against Less_Tree_HasValueProperty which was introduced in T327082.
Later we found out that we may solve the tech-debt problem without introducing the interface, mostly it was mostly successful, but we ended up leaving one instance: the _minMax function that still checks against the interface (see https://github.com/wikimedia/less.php/blob/b60b3d7f8bad9f30c5e8fffaf7feaa390e0dd5e8/lib/Less/Functions.php#L676_ ).
This call was left as it is, as in general the min/max methods can take a list of any type - not sure if the syntax allows it. We found out that this part of the code is not well tested (we do not have code coverage for that specific scenario) therefore doing any changes there is very risky.
Explore the possibility to remove the dependency upon Less_Tree_HasValue and check against only types that are valid in this scenario. Before working on it, check T349580 as it may help you bring better test coverage for the _minmax method.
Definition of done:
- Tests coverage for _minMax is improved.
- There are no usage of the Less_Tree_HasValueProperty interface left.
- The interface is removed from the library.