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;
	}
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;
	}
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 ; }
Initializes a browser with given configuration.

@param array $parameters Browser configuration parameters.

@return self
@throws \InvalidArgumentException When unknown parameter is discovered.
Initializes a browser with given configuration .