code: public function withHost(string $host): self
      {
          if ('/' === \mb_substr($host, -1)) {
              $host = \mb_substr($host, 0, -1);
          }
  
          $this->host = $host;
  
          return $this;
      }
docs: @param string $host
  
  @return self