original_string: protected function extractPaginationInfo(& $cql)
      {
          $words = explode(' ', $cql);
          $limit = 0;
          $offset = 0;
          $limitKey = null;
          foreach ($words as $key => $word) {
              if ('limit' === strtolower($word) && is_numeric($words[$key + 1])) {
                  $limit = (int)$words[$key + 1];
                  $limitKey = $key + 1;
              }
              if ('offset' === strtolower($word) && is_numeric($words[$key + 1])) {
                  $offset = (int)$words[$key + 1];
                  //Take out offset from CQL. It is not supported.
                  unset($words[$key], $words[$key + 1]);
              }
          }
  
          //Offset is not supported by CQL. Therefore need to modify limit based on offset.
          //Adding offset to limit in order to fetch all available records.
          $limit += $offset;
          if ($limitKey !== null) {
              $words[$limitKey] = $limit;
          }
          $cql = implode(' ', $words);
  
          return ['limit' => $limit, 'offset' => $offset];
      }
code: protected function extractPaginationInfo(& $cql)
      {
          $words = explode(' ', $cql);
          $limit = 0;
          $offset = 0;
          $limitKey = null;
          foreach ($words as $key => $word) {
              if ('limit' === strtolower($word) && is_numeric($words[$key + 1])) {
                  $limit = (int)$words[$key + 1];
                  $limitKey = $key + 1;
              }
              if ('offset' === strtolower($word) && is_numeric($words[$key + 1])) {
                  $offset = (int)$words[$key + 1];
                  //Take out offset from CQL. It is not supported.
                  unset($words[$key], $words[$key + 1]);
              }
          }
  
          //Offset is not supported by CQL. Therefore need to modify limit based on offset.
          //Adding offset to limit in order to fetch all available records.
          $limit += $offset;
          if ($limitKey !== null) {
              $words[$limitKey] = $limit;
          }
          $cql = implode(' ', $words);
  
          return ['limit' => $limit, 'offset' => $offset];
      }
code_tokens: protected function extractPaginationInfo ( & $ cql ) { $ words = explode ( ' ' , $ cql ) ; $ limit = 0 ; $ offset = 0 ; $ limitKey = null ; foreach ( $ words as $ key => $ word ) { if ( 'limit' === strtolower ( $ word ) && is_numeric ( $ words [ $ key + 1 ] ) ) { $ limit = ( int ) $ words [ $ key + 1 ] ; $ limitKey = $ key + 1 ; } if ( 'offset' === strtolower ( $ word ) && is_numeric ( $ words [ $ key + 1 ] ) ) { $ offset = ( int ) $ words [ $ key + 1 ] ; //Take out offset from CQL. It is not supported. unset ( $ words [ $ key ] , $ words [ $ key + 1 ] ) ; } } //Offset is not supported by CQL. Therefore need to modify limit based on offset. //Adding offset to limit in order to fetch all available records. $ limit += $ offset ; if ( $ limitKey !== null ) { $ words [ $ limitKey ] = $ limit ; } $ cql = implode ( ' ' , $ words ) ; return [ 'limit' => $ limit , 'offset' => $ offset ] ; }
docstring: Extracts pagination info from CQL.
  
  @param $cql
  
  @return array
docstring_tokens: Extracts pagination info from CQL .