original_string: public function setup(array $parameters)
  	{
  		$parameters = $this->prepareParameters($parameters);
  
  		// Make sure, that 'driver' parameter is handled first.
  		if ( isset($parameters['driver']) ) {
  			$this->setDriver($parameters['driver']);
  			unset($parameters['driver']);
  		}
  
  		foreach ( $parameters as $name => $value ) {
  			$method = 'set' . ucfirst($name);
  
  			if ( !method_exists($this, $method) ) {
  				throw new \InvalidArgumentException('Unable to set unknown parameter "' . $name . '"');
  			}
  
  			$this->$method($value);
  		}
  
  		return $this;
  	}
code: public function setup(array $parameters)
  	{
  		$parameters = $this->prepareParameters($parameters);
  
  		// Make sure, that 'driver' parameter is handled first.
  		if ( isset($parameters['driver']) ) {
  			$this->setDriver($parameters['driver']);
  			unset($parameters['driver']);
  		}
  
  		foreach ( $parameters as $name => $value ) {
  			$method = 'set' . ucfirst($name);
  
  			if ( !method_exists($this, $method) ) {
  				throw new \InvalidArgumentException('Unable to set unknown parameter "' . $name . '"');
  			}
  
  			$this->$method($value);
  		}
  
  		return $this;
  	}
code_tokens: public function setup ( array $ parameters ) { $ parameters = $ this -> prepareParameters ( $ parameters ) ; // Make sure, that 'driver' parameter is handled first. if ( isset ( $ parameters [ 'driver' ] ) ) { $ this -> setDriver ( $ parameters [ 'driver' ] ) ; unset ( $ parameters [ 'driver' ] ) ; } foreach ( $ parameters as $ name => $ value ) { $ method = 'set' . ucfirst ( $ name ) ; if ( ! method_exists ( $ this , $ method ) ) { throw new \ InvalidArgumentException ( 'Unable to set unknown parameter "' . $ name . '"' ) ; } $ this -> $ method ( $ value ) ; } return $ this ; }
docstring: Initializes a browser with given configuration.
  
  @param array $parameters Browser configuration parameters.
  
  @return self
  @throws \InvalidArgumentException When unknown parameter is discovered.
docstring_tokens: Initializes a browser with given configuration .