Returns the comment block used when creating the section as an array of
paragraphs within the comment block

@return array
777962
protected function getCommentSections()
    {
        if (empty($this->commentSections) && $this->rawComment) {
            $this->commentSections = explode("\n\n", $this->rawComment);
        }

        return $this->commentSections;
    }
363891
protected function getTagPatterns()
    {
        return [
            // block tag
            '/^(<([a-z]+)(?:[^>]*)>(?:[^<]*)<\/(?:\2)>)/' => static::MATCH_INDENT_NO,
            // DOCTYPE
            '/^<!([^>]*)>/' => static::MATCH_INDENT_NO,
            // tag with implied closing
            '/^<(' . $this->getUnpairedElements(true) . ')([^>]*)>/' => static::MATCH_INDENT_NO,
            // opening tag
            '/^<[^\/]([^>]*)>/' => static::MATCH_INDENT_INCREASE,
            // closing tag
            '/^<\/([^>]*)>/' => static::MATCH_INDENT_DECREASE,
            // self-closing tag
            '/^<(.+)\/>/' => static::MATCH_INDENT_DECREASE,
            // whitespace
            '/^(\s+)/' => static::MATCH_DISCARD,
            // text node
            '/([^<]+)/' => static::MATCH_INDENT_NO,
        ];
    }
161632
public function get_content_box()
    {
        $style = $this->_style;
        $cb = $this->_containing_block;

        $x = $this->_position["x"] +
            (float)$style->length_in_pt(array($style->margin_left,
                    $style->border_left_width,
                    $style->padding_left),
                $cb["w"]);

        $y = $this->_position["y"] +
            (float)$style->length_in_pt(array($style->margin_top,
                    $style->border_top_width,
                    $style->padding_top),
                $cb["h"]);

        $w = $style->length_in_pt($style->width, $cb["w"]);

        $h = $style->length_in_pt($style->height, $cb["h"]);

        return array(0 => $x, "x" => $x,
            1 => $y, "y" => $y,
            2 => $w, "w" => $w,
            3 => $h, "h" => $h);
    }
263121
private function getCommentDescriptionEndPointer(): int
    {
        $descriptionStartPtr = $this->getCommentDescriptionStartPointer();

        $commentStartToken = $this->docHelper->getBlockStartToken();
        $commentEndPtr = $this->docHelper->getBlockEndPosition();

        //If no tags found, possible end of search is the starting tag of the doc comment.
        if (count($commentStartToken['comment_tags']) === 0) {
            return $this->file->findPrevious(
                [T_DOC_COMMENT_STRING],
                $commentEndPtr - 1,
                $descriptionStartPtr
            );
        }

        //else its the pointer of the first comment tag found.
        $firstTagPtr = array_shift($commentStartToken['comment_tags']);

        return $this->file->findPrevious(
            [T_DOC_COMMENT_STRING],
            $firstTagPtr - 1,
            $descriptionStartPtr
        );
    }
551051
protected function _commentNode()
    {
        $this->_codeNode();
        $token = $this->_stream->current(true);
        $this->_states['body'] = $token[1];
        $node = new NodeDef($this->_states['body'], 'comment');
        return $this->_contextualize($node);
    }
283383
protected function getClassDocBlockLines() {
    $lines = [];

    if (!empty($this->component_data['class_docblock_lines'])) {
      $lines = $this->component_data['class_docblock_lines'];

      if (count($lines) > 1) {
        // If there is more than one line, splice in a blank line after the
        // first one.
        array_splice($lines, 1, 0, '');
      }
    }
    elseif (!empty($this->component_data['docblock_first_line'])) {
      $lines[] = $this->component_data['docblock_first_line'];
    }

    return $lines;
  }
242948
public function getBlocks()
    {
        $sanitizedBlocks = [];

        foreach ($this->blocks as $block) {
            $sanitizedBlock = $this->handler->sanitizeBlock($block['type'], $block['data']);
            if (!empty($sanitizedBlock)) {
                array_push($sanitizedBlocks, $sanitizedBlock);
            }
        }

        return $sanitizedBlocks;
    }
1196072
public function getWiths() {
		$ret = array ();
		foreach($this->blockManifest as $block) {
			if($block->isWith()) {
				$ret[] = $block;
			}
		}

		return $ret;
	}
1149261
public function getComments()
    {
        $args_comments = [
            'post_id' => $this->ID,
            'orderby' => 'comment_date_gmt',
            'status' => static::STATUS_APPROVE,
        ];
        $comments = [];
        foreach (get_comments($args_comments, $this->ID) as $c) {
            $comments[] = Comment::find($c->comment_ID);
        }
        return $comments;
    }
416365
public function Comments()
    {
        $list = $this->AllVisibleComments();

        // If nesting comments, only show root level
        if ($this->owner->getCommentsOption('nested_comments')) {
            $list = $list->filter('ParentCommentID', 0);
        }

        $this->owner->extend('updateComments', $list);
        return $list;
    }
923027
public function getCommentForm()
    {
        $postId = $_POST['postId'] ?? null;
        $commentId = $_POST['commentId'] ?? null;

        if (!$commentId || !$postId || !$comment = get_comment($commentId)) {
            wp_send_json_error('Missing variables');
        }

        if (!$comment = get_comment($commentId)) {
            wp_send_json_error('Comment is missing');
        }

        $args = array(
            'id_form' => 'commentupdate',
            'class_submit' => 'btn btn-sm btn-primary',
            'title_reply' => '',
            'title_reply_before' => '',
            'title_reply_after' => '',
            'label_submit' => __('Update', 'municipio'),
            'logged_in_as' => '',
            'comment_field' => '<textarea id="update-comment" name="comment" cols="45" rows="8" aria-required="true">' . $comment->comment_content . '</textarea>',
            'comment_notes_after' => '<input type="hidden" name="commentId" value="' . $commentId . '">
            <input type="hidden" name="nonce" value="' . wp_create_nonce("update-comment_$commentId") . '">',
            'submit_button' => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" /> <a href="#" class="cancel-update-comment gutter gutter-left gutter-sm"><small>' . __('Cancel', 'municipio') . '</small></a>'
        );

        ob_start();
        comment_form($args, $postId);
        $form = ob_get_clean();
        $form = str_replace('class="comment-respond"', 'class="comment-respond comment-respond-new comment-update"', $form);
        $form = str_replace('id="respond"', 'id="respond-edit"', $form);

        wp_send_json_success($form);
    }
774041
function getLastCommentLineOfBlock(commentStartLine) {
            const currentCommentEnd = commentEndLine[commentStartLine];

            return commentEndLine[currentCommentEnd + 1] ? getLastCommentLineOfBlock(currentCommentEnd + 1) : currentCommentEnd;
        }
1372469
public function getThirdPartyBlocks()
    {
        /** @var Application $application */
        $application = $this->get('application');
        $embeddedComposer = $application->getEmbeddedComposer();
        $config = $embeddedComposer->getExternalComposerConfig();
        $loadBlock = $config->has('block-loader') ? $config->get('block-loader') : '.bldr/blocks.yml';
        $blockFile = $embeddedComposer->getExternalRootDirectory().DIRECTORY_SEPARATOR.$loadBlock;

        if (!file_exists($blockFile)) {
            return [];
        }

        $blockNames = Yaml::parse(file_get_contents($blockFile));
        if (null === $blockNames) {
            return [];
        }

        $blocks     = [];
        foreach ($blockNames as $block) {
            $blocks[] = new $block();
        }

        return $blocks;
    }
491028
protected function getLinks()
    {
        if ($this->simple) {
            return '';
        }

        $block = [
            'first'  => null,
            'slider' => null,
            'last'   => null,
        ];

        $side   = 3;
        $window = $side * 2;

        if ($this->lastPage < $window + 6) {
            $block['first'] = $this->getUrlRange(1, $this->lastPage);
        } elseif ($this->currentPage <= $window) {
            $block['first'] = $this->getUrlRange(1, $window + 2);
            $block['last']  = $this->getUrlRange($this->lastPage - 1, $this->lastPage);
        } elseif ($this->currentPage > ($this->lastPage - $window)) {
            $block['first'] = $this->getUrlRange(1, 2);
            $block['last']  = $this->getUrlRange($this->lastPage - ($window + 2), $this->lastPage);
        } else {
            $block['first']  = $this->getUrlRange(1, 2);
            $block['slider'] = $this->getUrlRange($this->currentPage - $side, $this->currentPage + $side);
            $block['last']   = $this->getUrlRange($this->lastPage - 1, $this->lastPage);
        }

        $html = '';

        if (is_array($block['first'])) {
            $html .= $this->getUrlLinks($block['first']);
        }

        if (is_array($block['slider'])) {
            $html .= $this->getDots();
            $html .= $this->getUrlLinks($block['slider']);
        }

        if (is_array($block['last'])) {
            $html .= $this->getDots();
            $html .= $this->getUrlLinks($block['last']);
        }

        return $html;
    }
109255
public function getLines()
    {
        $lines = explode(PHP_EOL, $this->comment);

        $wrapper = function($line)
        {
            return new Line($line);
        };

        return array_map($wrapper, $lines);
    }
38519
public static function create($comment) {
    $block_comment = new LineCommentBlockNode();
    $comment = trim($comment);
    $lines = array_map('rtrim', explode("\n", $comment));
    foreach ($lines as $line) {
      $comment_node = new CommentNode(T_COMMENT, '// ' . $line . "\n");
      $block_comment->addChild($comment_node);
    }
    return $block_comment;
  }
1343187
private function validateDescriptions(): self
    {
        $commentPoss = TokenHelper::findNextAll(
            $this->file->getBaseFile(),
            [T_DOC_COMMENT_STRING, T_DOC_COMMENT_TAG],
            $this->getDocCommentPos(),
            $this->getDocHelper()->getBlockEndPosition()
        );

        foreach ($commentPoss as $index => $commentPos) {
            $commentToken = $this->tokens[$commentPos];
            $skipNewLineCheck = false;

            // We only search till the tags.
            if ($commentToken['code'] === T_DOC_COMMENT_TAG) {
                break;
            }

            if ($isFirstDocString = $index === 0) {
                $skipNewLineCheck = !$this->validateOneLineSummary();
            }

            $this->validateUCFirstDocComment($commentPos, $commentToken);

            if (!$skipNewLineCheck) {
                $this->validateNewLineAfterDocComment($commentPos, $commentToken, $isFirstDocString);
            }
        }

        return $this;

        ;
    }