original_string: private function getIndexRange($spec, $total)
      {
          $lastIndex = $total - 1;
          $indexStart = $spec['indexStart'];
          $indexEnd = $spec['indexEnd'];
          if ('#' === $indexStart) {
              if ('#' === $indexEnd or 0 === $indexEnd) {
                  return [$lastIndex];
              }
              $indexStart = $lastIndex;
              $indexEnd = $lastIndex - $indexEnd;
              $indexEnd = (0 > $indexEnd) ? 0 : $indexEnd;
          } else {
              if ($lastIndex < $indexStart) {
                  return [$indexStart]; // this will result to no hits
              }
  
              $indexEnd = ('#' === $indexEnd) ? $lastIndex : $indexEnd;
              if ($indexEnd > $lastIndex) {
                  $indexEnd = $lastIndex;
              }
          }
  
          return range($indexStart, $indexEnd);
      }
code: private function getIndexRange($spec, $total)
      {
          $lastIndex = $total - 1;
          $indexStart = $spec['indexStart'];
          $indexEnd = $spec['indexEnd'];
          if ('#' === $indexStart) {
              if ('#' === $indexEnd or 0 === $indexEnd) {
                  return [$lastIndex];
              }
              $indexStart = $lastIndex;
              $indexEnd = $lastIndex - $indexEnd;
              $indexEnd = (0 > $indexEnd) ? 0 : $indexEnd;
          } else {
              if ($lastIndex < $indexStart) {
                  return [$indexStart]; // this will result to no hits
              }
  
              $indexEnd = ('#' === $indexEnd) ? $lastIndex : $indexEnd;
              if ($indexEnd > $lastIndex) {
                  $indexEnd = $lastIndex;
              }
          }
  
          return range($indexStart, $indexEnd);
      }
code_tokens: private function getIndexRange ( $ spec , $ total ) { $ lastIndex = $ total - 1 ; $ indexStart = $ spec [ 'indexStart' ] ; $ indexEnd = $ spec [ 'indexEnd' ] ; if ( '#' === $ indexStart ) { if ( '#' === $ indexEnd or 0 === $ indexEnd ) { return [ $ lastIndex ] ; } $ indexStart = $ lastIndex ; $ indexEnd = $ lastIndex - $ indexEnd ; $ indexEnd = ( 0 > $ indexEnd ) ? 0 : $ indexEnd ; } else { if ( $ lastIndex < $ indexStart ) { return [ $ indexStart ] ; // this will result to no hits } $ indexEnd = ( '#' === $ indexEnd ) ? $ lastIndex : $ indexEnd ; if ( $ indexEnd > $ lastIndex ) { $ indexEnd = $ lastIndex ; } } return range ( $ indexStart , $ indexEnd ) ; }
docstring: Calculates a range from indexStart and indexEnd.
  
  @param array $spec  The spec with possible indizes
  @param int   $total Total count of (sub)fields
  
  @return array The range of indizes
docstring_tokens: Calculates a range from indexStart and indexEnd .