original_string: public function limit($limit = null)
      {
          if ($limit) {
              if ($limit < 0) {
                  $this->items = array_slice($this->items, $limit, abs($limit));
              }
              else {
                  $this->items = array_slice($this->items, 0, $limit);
              }
          }
  
          return $this;
      }
code: public function limit($limit = null)
      {
          if ($limit) {
              if ($limit < 0) {
                  $this->items = array_slice($this->items, $limit, abs($limit));
              }
              else {
                  $this->items = array_slice($this->items, 0, $limit);
              }
          }
  
          return $this;
      }
code_tokens: public function limit ( $ limit = null ) { if ( $ limit ) { if ( $ limit < 0 ) { $ this -> items = array_slice ( $ this -> items , $ limit , abs ( $ limit ) ) ; } else { $ this -> items = array_slice ( $ this -> items , 0 , $ limit ) ; } } return $ this ; }
docstring: Limits the number of results.
  
  @param int|null $limit
  @return ElasticCollection
docstring_tokens: Limits the number of results .