original_string: public function addDataSource($name, AbstractDataSource $dataSource)
      {
          if ($this->hasDataSource($name)) {
              throw new \RuntimeException(sprintf('A previous data source exists with the same name: "%s".', $name));
          }
  
          $this->dataSources[$name] = $dataSource;
      }
code: public function addDataSource($name, AbstractDataSource $dataSource)
      {
          if ($this->hasDataSource($name)) {
              throw new \RuntimeException(sprintf('A previous data source exists with the same name: "%s".', $name));
          }
  
          $this->dataSources[$name] = $dataSource;
      }
code_tokens: public function addDataSource ( $ name , AbstractDataSource $ dataSource ) { if ( $ this -> hasDataSource ( $ name ) ) { throw new \ RuntimeException ( sprintf ( 'A previous data source exists with the same name: "%s".' , $ name ) ) ; } $ this -> dataSources [ $ name ] = $ dataSource ; }
docstring: Adds a new data source.
  
  @param string             $name       The name of the data source
  @param AbstractDataSource $dataSource
  
  @throws \RuntimeException If a previous data sources exists with the same name
docstring_tokens: Adds a new data source .