original_string: public function add(ItemInterface $item)
      {
          if ($this->has($item->getId()) === true) {
              throw new \RuntimeException(sprintf('A previous item exists with the same id: "%s".', $item->getId()));
          }
  
          $this->set($item);
      }
code: public function add(ItemInterface $item)
      {
          if ($this->has($item->getId()) === true) {
              throw new \RuntimeException(sprintf('A previous item exists with the same id: "%s".', $item->getId()));
          }
  
          $this->set($item);
      }
code_tokens: public function add ( ItemInterface $ item ) { if ( $ this -> has ( $ item -> getId ( ) ) === true ) { throw new \ RuntimeException ( sprintf ( 'A previous item exists with the same id: "%s".' , $ item -> getId ( ) ) ) ; } $ this -> set ( $ item ) ; }
docstring: Adds an new item.
  
  @param Yosymfony\Spress\Core\DataSource\ItemInterface $item
  
  @throws \RuntimeException If the item has been registered previously with the same id
docstring_tokens: Adds an new item .