protected function getClassFromPercent($percent)
    {
        $mapping = array(95, 70, 50, 30, 15, 5, 0);
        foreach ($mapping as $key => $value) {
            if ($percent >= $value) {
                return $key;
            }
        }
        return 0;
    }
protected function getClassFromPercent($percent)
    {
        $mapping = array(95, 70, 50, 30, 15, 5, 0);
        foreach ($mapping as $key => $value) {
            if ($percent >= $value) {
                return $key;
            }
        }
        return 0;
    }
protected function getClassFromPercent ( $ percent ) { $ mapping = array ( 95 , 70 , 50 , 30 , 15 , 5 , 0 ) ; foreach ( $ mapping as $ key => $ value ) { if ( $ percent >= $ value ) { return $ key ; } } return 0 ; }
Get the class range using a percentage

@param $percent

@return int class
Get the class range using a percentage