@@ 86-97 (lines=12) @@ | ||
83 | } |
|
84 | } |
|
85 | ||
86 | final public function setConfig($config) |
|
87 | { |
|
88 | if ($config instanceof Collection) { |
|
89 | $this->config = $config; |
|
90 | } elseif (is_array($config)) { |
|
91 | $this->config = new Collection($config); |
|
92 | } else { |
|
93 | throw new InvalidArgumentException('Config must be an array or Collection'); |
|
94 | } |
|
95 | ||
96 | return $this; |
|
97 | } |
|
98 | ||
99 | final public function getConfig($key = false) |
|
100 | { |
|
@@ 469-481 (lines=13) @@ | ||
466 | /** |
|
467 | * @deprecated |
|
468 | */ |
|
469 | public function setDefaultHeaders($headers) |
|
470 | { |
|
471 | Version::warn(__METHOD__ . ' is deprecated. Use the request.options array to specify default request options'); |
|
472 | if ($headers instanceof Collection) { |
|
473 | $this->defaultHeaders = $headers; |
|
474 | } elseif (is_array($headers)) { |
|
475 | $this->defaultHeaders = new Collection($headers); |
|
476 | } else { |
|
477 | throw new InvalidArgumentException('Headers must be an array or Collection'); |
|
478 | } |
|
479 | ||
480 | return $this; |
|
481 | } |
|
482 | ||
483 | /** |
|
484 | * @deprecated |