public function addDocBlock()

in src/HackBuilder.hack [511:527]


  public function addDocBlock(?string $comment, ?int $max_length = null): this {
    if ($comment === '' || $comment === null) {
      return $this;
    }
    // Max length of each line of the docblock.  Substract 3 to compensate
    // for the initial " * "
    $max_length =
      $max_length !== null ? $max_length : $this->getMaxCodeLength() - 3;

    $lines = $this->splitString($comment, $max_length);
    $this->ensureNewLine()->addLine('/**');
    foreach ($lines as $line) {
      $this->addLine(\rtrim(' * '.$line));
    }
    $this->addLine(' */');
    return $this;
  }