public function setBaseUrl($url) { if (substr($url, -1) !== '/') { $url .= '/'; } $this->baseUrl = $url; return $this; }