protected static function consumeChildren()

in src/unparsed-blocks/ContainerBlock.php [27:48]


  protected static function consumeChildren(
    Context $context,
    Lines $lines,
  ): vec<Block> {
    $children = vec[];
    while (!$lines->isEmpty()) {
      $pre_count = $lines->getCount();
      list($child, $lines) = self::consumeSingle($context, $lines);
      invariant(
        $pre_count > $lines->getCount(),
        'consuming failed to reduce line count with class "%s" on line "%s"',
        \get_class($child),
        $lines->getFirstLine(),
      );
      if ($child is BlockSequence) {
        $children = Vec\concat($children, $child->getChildren());
      } else {
        $children[] = $child;
      }
    }
    return $children;
  }