private function lookupPath()

in src/HHClientFallbackHandler.hack [190:220]


  private function lookupPath(string $kind, string $name): ?string {
    $key = $kind.'!'.$name;
    if (C\contains_key(static::$cache, $key)) {
      return static::$cache[$key];
    }

    $path = $this->lookupPathImpl($kind, $name);
    static::$cache[$key] = $path;

    if ($path === null) {
      return $path;
    }

    switch ($kind) {
      case 'class':
        $this->map['class'][\strtolower($name)] = $path;
        break;
      case 'type':
      case 'typedef':
        $this->map['type'][\strtolower($name)] = $path;
        break;
      case 'function':
        $this->map['function'][\strtolower($name)] = $path;
        break;
      case 'constant':
        $this->map['constant'][$name] = $path;
        break;
    }
    $this->dirty = true;
    return $path;
  }