public function get_min_max_of($attribute) {
        $getmethod = 'get_min_max_of_' . $attribute;
        if (method_exists($this, $getmethod)) {
            return $this->$getmethod();
        } else {
            $min = $max = null;
            $set = false;

            // We cannot simply use min or max functions because, in theory, some attributes might be non-scalar.
            foreach (array_column($this->subqstats, $attribute) as $value) {
                if (is_scalar($value) || is_null($value)) {
                    if (!$set) {    // It is not good enough to check if (!isset($min)),
                                    // because $min might have been set to null in an earlier iteration.
                        $min = $value;
                        $max = $value;
                        $set = true;
                    }

                    $min  = $this->min($min, $value);
                    $max  = $this->max($max, $value);
                }
            }

            return [$min, $max];
        }
    }
public function get_min_max_of($attribute) {
        $getmethod = 'get_min_max_of_' . $attribute;
        if (method_exists($this, $getmethod)) {
            return $this->$getmethod();
        } else {
            $min = $max = null;
            $set = false;

            // We cannot simply use min or max functions because, in theory, some attributes might be non-scalar.
            foreach (array_column($this->subqstats, $attribute) as $value) {
                if (is_scalar($value) || is_null($value)) {
                    if (!$set) {    // It is not good enough to check if (!isset($min)),
                                    // because $min might have been set to null in an earlier iteration.
                        $min = $value;
                        $max = $value;
                        $set = true;
                    }

                    $min  = $this->min($min, $value);
                    $max  = $this->max($max, $value);
                }
            }

            return [$min, $max];
        }
    }
public function get_min_max_of ( $ attribute ) { $ getmethod = 'get_min_max_of_' . $ attribute ; if ( method_exists ( $ this , $ getmethod ) ) { return $ this -> $ getmethod ( ) ; } else { $ min = $ max = null ; $ set = false ; // We cannot simply use min or max functions because, in theory, some attributes might be non-scalar. foreach ( array_column ( $ this -> subqstats , $ attribute ) as $ value ) { if ( is_scalar ( $ value ) || is_null ( $ value ) ) { if ( ! $ set ) { // It is not good enough to check if (!isset($min)), // because $min might have been set to null in an earlier iteration. $ min = $ value ; $ max = $ value ; $ set = true ; } $ min = $ this -> min ( $ min , $ value ) ; $ max = $ this -> max ( $ max , $ value ) ; } } return [ $ min , $ max ] ; } }
Returns the minimum and maximum values of the given attribute in the summarised calculated stats.

@param string $attribute The attribute that we are looking for its extremums.
@return array An array of [min,max]
Returns the minimum and maximum values of the given attribute in the summarised calculated stats .