original_string: public static function getEnvNameByDomain(string $defaultEnv = null, string $domain = null): string
      {
          $domain = $domain ?: PhpHelper::serverParam('HTTP_HOST');
  
          if (!$domain) {
              return $defaultEnv;
          }
  
          foreach (self::$domain2env as $kw => $env) {
              if (false !== strpos($domain, $kw)) {
                  return $env;
              }
          }
  
          return $defaultEnv;
      }
code: public static function getEnvNameByDomain(string $defaultEnv = null, string $domain = null): string
      {
          $domain = $domain ?: PhpHelper::serverParam('HTTP_HOST');
  
          if (!$domain) {
              return $defaultEnv;
          }
  
          foreach (self::$domain2env as $kw => $env) {
              if (false !== strpos($domain, $kw)) {
                  return $env;
              }
          }
  
          return $defaultEnv;
      }
code_tokens: public static function getEnvNameByDomain ( string $ defaultEnv = null , string $ domain = null ) : string { $ domain = $ domain ? : PhpHelper :: serverParam ( 'HTTP_HOST' ) ; if ( ! $ domain ) { return $ defaultEnv ; } foreach ( self :: $ domain2env as $ kw => $ env ) { if ( false !== strpos ( $ domain , $ kw ) ) { return $ env ; } } return $ defaultEnv ; }
docstring: get Env Name By Domain
  @param string $defaultEnv
  @param null|string $domain
  @return string
docstring_tokens: get Env Name By Domain