src/main/php/Reducer.php
public function toMin(callable $min = null)
    {
        if (null === $min) {
            // can't use min() as $smallest is initially null but actual
            // elements were not checked yet, and min() considers null to always
            // be the minimum value
            $min = function($smallest, $element)
                   {
                       return (null === $smallest || $element < $smallest) ? $element : $smallest;
                   };
        }

        return $this->with($min);
    }
public function toMin(callable $min = null)
    {
        if (null === $min) {
            // can't use min() as $smallest is initially null but actual
            // elements were not checked yet, and min() considers null to always
            // be the minimum value
            $min = function($smallest, $element)
                   {
                       return (null === $smallest || $element < $smallest) ? $element : $smallest;
                   };
        }

        return $this->with($min);
    }
public function toMin ( callable $ min = null ) { if ( null === $ min ) { // can't use min() as $smallest is initially null but actual // elements were not checked yet, and min() considers null to always // be the minimum value $ min = function ( $ smallest , $ element ) { return ( null === $ smallest || $ element < $ smallest ) ? $ element : $ smallest ; } ; } return $ this -> with ( $ min ) ; }
reduce to smallest element

@api
@param   callable  $min  optional  different function to calculate the minimum, i.e. when elements are not numbers
@return  mixed
reduce to smallest element