original_string: public function get_progress_proportion_range() {
          // If there is no progress underway, we must have finished.
          if (empty($this->currents)) {
              return array(1.0, 1.0);
          }
          $count = count($this->currents);
          $min = 0.0;
          $max = 1.0;
          for ($i = 0; $i < $count; $i++) {
              // Get max value at that section - if it's indeterminate we can tell
              // no more.
              $sectionmax = $this->maxes[$i];
              if ($sectionmax === self::INDETERMINATE) {
                  return array($min, $max);
              }
  
              // Special case if current value is max (this should only happen
              // just before ending a section).
              $sectioncurrent = $this->currents[$i];
              if ($sectioncurrent === $sectionmax) {
                  return array($max, $max);
              }
  
              // Using the current value at that section, we know we are somewhere
              // between 'current' and the next 'current' value which depends on
              // the parentcount of the nested section (if any).
              $newmin = ($sectioncurrent / $sectionmax) * ($max - $min) + $min;
              $nextcurrent = $sectioncurrent + 1;
              if ($i + 1 < $count) {
                  $weight = $this->parentcounts[$i + 1];
                  $nextcurrent = $sectioncurrent + $weight;
              }
              $newmax = ($nextcurrent / $sectionmax) * ($max - $min) + $min;
              $min = $newmin;
              $max = $newmax;
          }
  
          // If there was nothing indeterminate, we use the min value as current.
          return array($min, $min);
      }
code: public function get_progress_proportion_range() {
          // If there is no progress underway, we must have finished.
          if (empty($this->currents)) {
              return array(1.0, 1.0);
          }
          $count = count($this->currents);
          $min = 0.0;
          $max = 1.0;
          for ($i = 0; $i < $count; $i++) {
              // Get max value at that section - if it's indeterminate we can tell
              // no more.
              $sectionmax = $this->maxes[$i];
              if ($sectionmax === self::INDETERMINATE) {
                  return array($min, $max);
              }
  
              // Special case if current value is max (this should only happen
              // just before ending a section).
              $sectioncurrent = $this->currents[$i];
              if ($sectioncurrent === $sectionmax) {
                  return array($max, $max);
              }
  
              // Using the current value at that section, we know we are somewhere
              // between 'current' and the next 'current' value which depends on
              // the parentcount of the nested section (if any).
              $newmin = ($sectioncurrent / $sectionmax) * ($max - $min) + $min;
              $nextcurrent = $sectioncurrent + 1;
              if ($i + 1 < $count) {
                  $weight = $this->parentcounts[$i + 1];
                  $nextcurrent = $sectioncurrent + $weight;
              }
              $newmax = ($nextcurrent / $sectionmax) * ($max - $min) + $min;
              $min = $newmin;
              $max = $newmax;
          }
  
          // If there was nothing indeterminate, we use the min value as current.
          return array($min, $min);
      }
code_tokens: public function get_progress_proportion_range ( ) { // If there is no progress underway, we must have finished. if ( empty ( $ this -> currents ) ) { return array ( 1.0 , 1.0 ) ; } $ count = count ( $ this -> currents ) ; $ min = 0.0 ; $ max = 1.0 ; for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { // Get max value at that section - if it's indeterminate we can tell // no more. $ sectionmax = $ this -> maxes [ $ i ] ; if ( $ sectionmax === self :: INDETERMINATE ) { return array ( $ min , $ max ) ; } // Special case if current value is max (this should only happen // just before ending a section). $ sectioncurrent = $ this -> currents [ $ i ] ; if ( $ sectioncurrent === $ sectionmax ) { return array ( $ max , $ max ) ; } // Using the current value at that section, we know we are somewhere // between 'current' and the next 'current' value which depends on // the parentcount of the nested section (if any). $ newmin = ( $ sectioncurrent / $ sectionmax ) * ( $ max - $ min ) + $ min ; $ nextcurrent = $ sectioncurrent + 1 ; if ( $ i + 1 < $ count ) { $ weight = $ this -> parentcounts [ $ i + 1 ] ; $ nextcurrent = $ sectioncurrent + $ weight ; } $ newmax = ( $ nextcurrent / $ sectionmax ) * ( $ max - $ min ) + $ min ; $ min = $ newmin ; $ max = $ newmax ; } // If there was nothing indeterminate, we use the min value as current. return array ( $ min , $ min ) ; }
docstring: Obtains current progress in a way suitable for drawing a progress bar.
  
  Progress is returned as a minimum and maximum value. If there is no
  indeterminate progress, these values will be identical. If there is
  intermediate progress, these values can be different. (For example, if
  the top level progress sections is indeterminate, then the values will
  always be 0.0 and 1.0.)
  
  @return array Minimum and maximum possible progress proportions
docstring_tokens: Obtains current progress in a way suitable for drawing a progress bar .