@@ -133,25 +133,21 @@ protected function resource(string $class): Resource
133133
134134 protected function baseUrl (?string $ baseUrl ): static
135135 {
136- $ this ->setBaseUrl ( $ baseUrl) ;
136+ $ this ->baseUrl = $ baseUrl ;
137137
138138 return $ this ;
139139 }
140140
141141 protected function queryDefaults (array $ query ): static
142142 {
143- foreach ($ query as $ name => $ value ) {
144- $ this ->addQueryDefault ($ name , $ value );
145- }
143+ $ this ->queryDefaults = array_merge ($ this ->queryDefaults , $ query );
146144
147145 return $ this ;
148146 }
149147
150148 protected function headerDefaults (array $ headers ): static
151149 {
152- foreach ($ headers as $ name => $ value ) {
153- $ this ->addHeaderDefault ($ name , $ value );
154- }
150+ $ this ->headerDefaults = array_merge ($ this ->headerDefaults , $ headers );
155151
156152 return $ this ;
157153 }
@@ -257,56 +253,6 @@ private function buildPlugins(): array
257253 return $ plugins ->all ();
258254 }
259255
260- public function getBaseUrl (): ?string
261- {
262- return $ this ->baseUrl ;
263- }
264-
265- public function setBaseUrl (?string $ baseUrl ): self
266- {
267- $ this ->baseUrl = $ baseUrl ;
268-
269- return $ this ;
270- }
271-
272- public function getQueryDefault (string $ name ): mixed
273- {
274- return $ this ->queryDefaults [$ name ] ?? null ;
275- }
276-
277- public function addQueryDefault (string $ name , mixed $ value ): self
278- {
279- $ this ->queryDefaults [$ name ] = $ value ;
280-
281- return $ this ;
282- }
283-
284- public function removeQueryDefault (string $ name ): self
285- {
286- unset($ this ->queryDefaults [$ name ]);
287-
288- return $ this ;
289- }
290-
291- public function getHeaderDefault (string $ name ): mixed
292- {
293- return $ this ->headerDefaults [$ name ] ?? null ;
294- }
295-
296- public function addHeaderDefault (string $ name , mixed $ value ): self
297- {
298- $ this ->headerDefaults [$ name ] = $ value ;
299-
300- return $ this ;
301- }
302-
303- public function removeHeaderDefault (string $ name ): self
304- {
305- unset($ this ->headerDefaults [$ name ]);
306-
307- return $ this ;
308- }
309-
310256 public function getClientBuilder (): ?ClientBuilder
311257 {
312258 return $ this ->clientBuilder ;
@@ -352,7 +298,7 @@ public function addResponseContentsListener(callable $listener, int $priority =
352298 return $ this ;
353299 }
354300
355- public function buildPath (string $ path , array $ parameters ): string
301+ private function buildPath (string $ path , array $ parameters ): string
356302 {
357303 foreach ($ parameters as $ parameter => $ value ) {
358304 $ path = str_replace (
0 commit comments