original_string: public function getFilterQuery(array $default = array(), $allowed = array())
      {
          $query = $this->query;
          foreach ($query as $key => $value) {
  
              if (!is_string($value)) {
                  continue;
              }
  
              if ($key === 'sort' && strpos($value, '-') !== false) {
                  list($sort, $order) = explode('-', $value, 2);
                  $query['sort'] = $sort;
                  $query['order'] = $order;
              }
  
              if ($value === 'any') {
                  unset($query[$key]);
              }
          }
  
          $query += $default;
  
          if (empty($allowed)) {
              return $query;
          }
  
          return array_intersect_key($query, array_flip($allowed));
      }
code: public function getFilterQuery(array $default = array(), $allowed = array())
      {
          $query = $this->query;
          foreach ($query as $key => $value) {
  
              if (!is_string($value)) {
                  continue;
              }
  
              if ($key === 'sort' && strpos($value, '-') !== false) {
                  list($sort, $order) = explode('-', $value, 2);
                  $query['sort'] = $sort;
                  $query['order'] = $order;
              }
  
              if ($value === 'any') {
                  unset($query[$key]);
              }
          }
  
          $query += $default;
  
          if (empty($allowed)) {
              return $query;
          }
  
          return array_intersect_key($query, array_flip($allowed));
      }
code_tokens: public function getFilterQuery ( array $ default = array ( ) , $ allowed = array ( ) ) { $ query = $ this -> query ; foreach ( $ query as $ key => $ value ) { if ( ! is_string ( $ value ) ) { continue ; } if ( $ key === 'sort' && strpos ( $ value , '-' ) !== false ) { list ( $ sort , $ order ) = explode ( '-' , $ value , 2 ) ; $ query [ 'sort' ] = $ sort ; $ query [ 'order' ] = $ order ; } if ( $ value === 'any' ) { unset ( $ query [ $ key ] ) ; } } $ query += $ default ; if ( empty ( $ allowed ) ) { return $ query ; } return array_intersect_key ( $ query , array_flip ( $ allowed ) ) ; }
docstring: Returns an array of prepared GET values used for filtering and sorting
  @param array $default
  @param array $allowed
  @return array
docstring_tokens: Returns an array of prepared GET values used for filtering and sorting