public function getParameterInfo()

in src/DocBlock/DocBlock.hack [246:291]


  public function getParameterInfo(): dict<string, ParameterInfo> {
    $out = dict[];
    foreach ($this->tags as list($key, $value)) {
      if ($key !== '@param') {
        continue;
      }
      if ($value === null) {
        continue;
      }
      $name = null;

      $dollar = Str\search($value, '$');
      if ($dollar === null) {
        continue;
      }

      $space = Str\search($value, ' ');

      if ($space === null) {
        $type = null;
        $space = Str\length($value);
      } else if ($space > $dollar) {
        $type = null;
      } else {
        $type = Str\trim(Str\slice($value, 0, $dollar - 1));
        if ($type === '') {
          $type = null;
        }
      }

      $space = Str\search($value, ' ', $dollar);
      if ($space === null) {
        $name = Str\slice($value, $dollar);
        $text = null;
      } else {
        $name = Str\slice($value, $dollar, $space - $dollar);
        $text = Str\trim(Str\slice($value, $space));
      }
      $out[$name] = shape(
        'name' => $name,
        'types' => self::typeToTypes($type),
        'text' => $text,
      );
    }
    return $out;
  }