original_string: public function fetchGroups(GroupFilter $filter = null)
      {
          return new Api\Pages(
              function ($page) use ($filter) {
                  $params = ["page=$page"];
  
                  if (!is_null($filter)) {
                      if (null != $filter->getPageSize()) {
                          array_push(
                              $params, 'page_size=' . $filter->getPageSize()
                          );
                      }
  
                      if (null != $filter->getTags()) {
                          $val = urlencode(join(',', $filter->getTags()));
                          array_push($params, 'tags=' . $val);
                      }
                  }
  
                  $q = join('&', $params);
                  $result = $this->_get($this->_url('/groups?' . $q));
                  return Deserialize::groupsPage($result);
              }
          );
      }
code: public function fetchGroups(GroupFilter $filter = null)
      {
          return new Api\Pages(
              function ($page) use ($filter) {
                  $params = ["page=$page"];
  
                  if (!is_null($filter)) {
                      if (null != $filter->getPageSize()) {
                          array_push(
                              $params, 'page_size=' . $filter->getPageSize()
                          );
                      }
  
                      if (null != $filter->getTags()) {
                          $val = urlencode(join(',', $filter->getTags()));
                          array_push($params, 'tags=' . $val);
                      }
                  }
  
                  $q = join('&', $params);
                  $result = $this->_get($this->_url('/groups?' . $q));
                  return Deserialize::groupsPage($result);
              }
          );
      }
code_tokens: public function fetchGroups ( GroupFilter $ filter = null ) { return new Api \ Pages ( function ( $ page ) use ( $ filter ) { $ params = [ "page=$page" ] ; if ( ! is_null ( $ filter ) ) { if ( null != $ filter -> getPageSize ( ) ) { array_push ( $ params , 'page_size=' . $ filter -> getPageSize ( ) ) ; } if ( null != $ filter -> getTags ( ) ) { $ val = urlencode ( join ( ',' , $ filter -> getTags ( ) ) ) ; array_push ( $ params , 'tags=' . $ val ) ; } } $ q = join ( '&' , $ params ) ; $ result = $ this -> _get ( $ this -> _url ( '/groups?' . $ q ) ) ; return Deserialize :: groupsPage ( $ result ) ; } ) ; }
docstring: Fetch the groups matching the given filter.
  
  Note, calling this method does not actually cause any network
  traffic. Listing groups in XMS may return the result over
  multiple pages and this call therefore returns an object of the
  type {@link \Clx\Xms\Api\Pages}, which will fetch result pages
  as needed.
  
  @param GroupFilter|null $filter the group filter
  
  @return Api\Pages the result pages
docstring_tokens: Fetch the groups matching the given filter .