Skip to content

Commit 6f9bf13

Browse files
committed
setPrefix method functionalities changes
1 parent 4615eda commit 6f9bf13

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/AbstractApi.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ abstract protected function baseUrl();
145145

146146
/**
147147
* set url prefix from code
148-
*
148+
* @param string $prefix
149149
* @return null|string
150150
*/
151-
protected function setPrefix()
151+
protected function setPrefix($prefix = '')
152152
{
153-
return null;
153+
return $this->prefix = $prefix;
154154
}
155155

156156
/**
@@ -458,13 +458,10 @@ protected function pushHttpExceptions(array $exceptions = [])
458458
*/
459459
protected function makeMethodRequest($method, $uri)
460460
{
461-
if (!is_null($this->setPrefix())) {
462-
$this->prefix = $this->setPrefix();
463-
}
461+
464462
if (!empty($this->prefix)) {
465463
$this->prefix = trim($this->prefix, '/') . '/';
466464
}
467-
468465
$uri = $this->prefix . trim($uri, '/');
469466

470467
$this->mergeDefaultHeaders();

0 commit comments

Comments
 (0)