original_string: protected function createFrom(array $elements, $keyField = null)
      {
          $collection = new static($elements, $this->_flexDirectory);
          $collection->setKeyField($keyField ?: $this->_keyField);
  
          return $collection;
      }
code: protected function createFrom(array $elements, $keyField = null)
      {
          $collection = new static($elements, $this->_flexDirectory);
          $collection->setKeyField($keyField ?: $this->_keyField);
  
          return $collection;
      }
code_tokens: protected function createFrom ( array $ elements , $ keyField = null ) { $ collection = new static ( $ elements , $ this -> _flexDirectory ) ; $ collection -> setKeyField ( $ keyField ? : $ this -> _keyField ) ; return $ collection ; }
docstring: Creates a new instance from the specified elements.
  
  This method is provided for derived classes to specify how a new
  instance should be created when constructor semantics have changed.
  
  @param array $elements Elements.
  @param string|null $keyField
  
  @return static
  @throws \InvalidArgumentException
docstring_tokens: Creates a new instance from the specified elements .