public function setEndpoint($endpoint) { $this->endpoint = substr($endpoint, -1) == "/" ? substr($endpoint, 0, -1) : $endpoint; return $this; }