original_string: private function cleanHostName(ServerRequestInterface $request)
      {
  
          if (is_null($this->baseHost)) {
              $hostname = $request->getUri()->getHost();
          } else {
              $hostname = str_replace($this->baseHost, "", $request->getUri()->getHost());
          }
  
          if (substr($hostname, -1) == ".") {
              $hostname = substr($hostname, 0, -1);
          }
  
          return $hostname;
      }
code: private function cleanHostName(ServerRequestInterface $request)
      {
  
          if (is_null($this->baseHost)) {
              $hostname = $request->getUri()->getHost();
          } else {
              $hostname = str_replace($this->baseHost, "", $request->getUri()->getHost());
          }
  
          if (substr($hostname, -1) == ".") {
              $hostname = substr($hostname, 0, -1);
          }
  
          return $hostname;
      }
code_tokens: private function cleanHostName ( ServerRequestInterface $ request ) { if ( is_null ( $ this -> baseHost ) ) { $ hostname = $ request -> getUri ( ) -> getHost ( ) ; } else { $ hostname = str_replace ( $ this -> baseHost , "" , $ request -> getUri ( ) -> getHost ( ) ) ; } if ( substr ( $ hostname , - 1 ) == "." ) { $ hostname = substr ( $ hostname , 0 , - 1 ) ; } return $ hostname ; }
docstring: will get hostname, and clean basehost off it
  
  @param ServerRequestInterface $request
  @return string
docstring_tokens: will get hostname and clean basehost off it