original_string: public function add($key, $data)
      {
          $toInsert = $this->getDocumentData($data);
  
          $result = $this->collection->insertOne($toInsert);
  
          $data->_id = $result->getInsertedId();
      }
code: public function add($key, $data)
      {
          $toInsert = $this->getDocumentData($data);
  
          $result = $this->collection->insertOne($toInsert);
  
          $data->_id = $result->getInsertedId();
      }
code_tokens: public function add ( $ key , $ data ) { $ toInsert = $ this -> getDocumentData ( $ data ) ; $ result = $ this -> collection -> insertOne ( $ toInsert ) ; $ data -> _id = $ result -> getInsertedId ( ) ; }
docstring: adds an item to the registry
  
  
  @param mixed $key
  @param mixed $data
  
  @throws \Exception
docstring_tokens: adds an item to the registry