/** * Initialize the object with parameters. * * @param array $parameters An associative array of parameters * * @return $this * @throws \RuntimeException */ public function initialize(array $parameters = array()) { if (null !== $this->response) { throw new \RuntimeException('Request cannot be modified after it has been sent!'); } $this->parameters = new ParameterBag(); Helper::initialize($this, $parameters); return $this; }
/** * Initialize this client with default parameters * * @param array $parameters * @return $this */ public function initialize(array $parameters = array()) { $this->parameters = new ParameterBag(); // set default parameters foreach ($this->getDefaultParameters() as $key => $value) { $this->parameters->set($key, $value); } Helper::initialize($this, $parameters); return $this; }