original_string: public static function isLocalHost($host)
      {
          if (empty($host)) {
              return false;
          }
  
          // remove port
          $hostWithoutPort = explode(':', $host);
          array_pop($hostWithoutPort);
          $hostWithoutPort = implode(':', $hostWithoutPort);
  
          $localHostnames = Url::getLocalHostnames();
          return in_array($host, $localHostnames, true)
              || in_array($hostWithoutPort, $localHostnames, true);
      }
code: public static function isLocalHost($host)
      {
          if (empty($host)) {
              return false;
          }
  
          // remove port
          $hostWithoutPort = explode(':', $host);
          array_pop($hostWithoutPort);
          $hostWithoutPort = implode(':', $hostWithoutPort);
  
          $localHostnames = Url::getLocalHostnames();
          return in_array($host, $localHostnames, true)
              || in_array($hostWithoutPort, $localHostnames, true);
      }
code_tokens: public static function isLocalHost ( $ host ) { if ( empty ( $ host ) ) { return false ; } // remove port $ hostWithoutPort = explode ( ':' , $ host ) ; array_pop ( $ hostWithoutPort ) ; $ hostWithoutPort = implode ( ':' , $ hostWithoutPort ) ; $ localHostnames = Url :: getLocalHostnames ( ) ; return in_array ( $ host , $ localHostnames , true ) || in_array ( $ hostWithoutPort , $ localHostnames , true ) ; }
docstring: Checks whether the given host is a local host like `127.0.0.1` or `localhost`.
  
  @param string $host
  @return bool
docstring_tokens: Checks whether the given host is a local host like 127 . 0 . 0 . 1 or localhost .