original_string: public function fetchInbounds(InboundsFilter $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->getRecipients()) {
                          $val = urlencode(join(',', $filter->getRecipients()));
                          array_push($params, 'to=' . $val);
                      }
  
                      if (null != $filter->getStartDate()) {
                          $val = $filter->getStartDate()->format('Y-m-d');
                          array_push($params, 'start_date=' . $val);
                      }
  
                      if (null != $filter->getEndDate()) {
                          $val = $filter->getEndDate()->format('Y-m-d');
                          array_push($params, 'end_date=' . $val);
                      }
                  }
  
                  $q = join('&', $params);
                  $result = $this->_get($this->_url('/inbounds?' . $q));
                  return Deserialize::inboundsPage($result);
              }
          );
      }
code: public function fetchInbounds(InboundsFilter $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->getRecipients()) {
                          $val = urlencode(join(',', $filter->getRecipients()));
                          array_push($params, 'to=' . $val);
                      }
  
                      if (null != $filter->getStartDate()) {
                          $val = $filter->getStartDate()->format('Y-m-d');
                          array_push($params, 'start_date=' . $val);
                      }
  
                      if (null != $filter->getEndDate()) {
                          $val = $filter->getEndDate()->format('Y-m-d');
                          array_push($params, 'end_date=' . $val);
                      }
                  }
  
                  $q = join('&', $params);
                  $result = $this->_get($this->_url('/inbounds?' . $q));
                  return Deserialize::inboundsPage($result);
              }
          );
      }
code_tokens: public function fetchInbounds ( InboundsFilter $ 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 -> getRecipients ( ) ) { $ val = urlencode ( join ( ',' , $ filter -> getRecipients ( ) ) ) ; array_push ( $ params , 'to=' . $ val ) ; } if ( null != $ filter -> getStartDate ( ) ) { $ val = $ filter -> getStartDate ( ) -> format ( 'Y-m-d' ) ; array_push ( $ params , 'start_date=' . $ val ) ; } if ( null != $ filter -> getEndDate ( ) ) { $ val = $ filter -> getEndDate ( ) -> format ( 'Y-m-d' ) ; array_push ( $ params , 'end_date=' . $ val ) ; } } $ q = join ( '&' , $ params ) ; $ result = $ this -> _get ( $ this -> _url ( '/inbounds?' . $ q ) ) ; return Deserialize :: inboundsPage ( $ result ) ; } ) ; }
docstring: Fetch inbound messages matching the given filter.
  
  Note, calling this method does not actually cause any network
  traffic. Listing inbound messages 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 InboundsFilter|null $filter the inbound message filter
  
  @return Api\Pages the result pages
docstring_tokens: Fetch inbound messages matching the given filter .