code: protected function detectType($type)
      {
          $type     = strtoupper($type);
          $constant = "\IntlDateFormatter::$type";
          $value    = @constant($constant);
          return null !== $value ? $value : IntlDateFormatter::NONE;
      }
docs: Maps strings and constants to IntlDateFormatter constants (int).
  
  @param string $type
  @return int