Returns true if the current line is the beginning of a file section.

@param string[] $diffLineList
@param int $currentLine

@return bool
421045
private function isFileStart(array $diffLineList, int $currentLine): bool
    {
        return $currentLine + 1 < count($diffLineList)
            && '---' === substr($diffLineList[$currentLine], 0, 3)
            && '+++' === substr($diffLineList[$currentLine + 1], 0, 3);
    }
421371
public boolean joinLine() {
		if (!isCurrentLine()) {
			return false;
		}
		if (!isNextLine()) {
			return false;
		}
		if (!isNextTag()) {
			return true; // no next tag -> continue block
		}
		if (!isCurrentTag()) {
			return false; // no current tag -> new block
		}
		// compare current and next tag
		return getCurrentTag().equals(getNextTag());
	}
1301834
public static function readSymmetry($fileName, $current = 1, $lineNum = 3): array
    {
        $startLine = $current - $lineNum;
        $endLine = $current + $lineNum;

        if ((int)$current < ($lineNum + 1)) {
            $startLine = 1;
            $endLine = 9;
        }

        return self::readLines($fileName, $startLine, $endLine);
    }
768579
private function shouldIgnoreLine(File $file, int $start, int $end): bool
    {
        return
            $this->containLongWords($file, $start, $end)
            || $this->isI18nFunction($file, $start, $end);
    }
1140853
private boolean commentLinesBefore( String content, int line ) {
        int offset = rootElement.getElement(line).getStartOffset();
        // Start of comment not found, nothing to do
        int startDelimiter = lastIndexOf(content, getStartDelimiter(), offset - 2);
        if (startDelimiter < 0)
            return false;
        // Matching start/end of comment found, nothing to do
        int endDelimiter = indexOf(content, getEndDelimiter(), startDelimiter);
        if (endDelimiter < offset & endDelimiter != -1)
            return false;
        // End of comment not found, highlight the lines
        doc.setCharacterAttributes(startDelimiter, offset - startDelimiter + 1, comment, false);
        return true;
    }
822609
public function diff($arExcludeIDList = [])
    {
        if (empty($arExcludeIDList) || $this->isEmpty()) {
            return $this->returnThis();
        }

        $this->arElementIDList = array_diff($this->arElementIDList, $arExcludeIDList);

        return $this->returnThis();
    }
1233071
function isLineStart(loc) {
            const actualText = getActualLineIndentText(loc.line)
            return actualText.length === loc.column
        }
1297663
protected function firstLinesRaw($lineCount=20)
    {
        if ($this->firstLinesRaw !== null) {
            return $this->firstLinesRaw;
        }

        $this->lineReader->setFilePath($this->filePath);

        $lines = [];

        foreach ($this->lineReader as $i=>$line) {
            $lines[] = $line;

            if ($i >= $lineCount) {
                break;
            }
        }

        $this->lineReader->releaseHandle();

        $this->firstLinesRaw = implode("\n", $lines);

        return $this->firstLinesRaw;
    }
753731
protected function checkInlineComments(File $phpCsFile, $startIndex, $endIndex) {
		$tokens = $phpCsFile->getTokens();

		for ($i = $startIndex + 1; $i < $endIndex; $i++) {
			if ($tokens[$i]['code'] !== T_DOC_COMMENT_OPEN_TAG) {
				continue;
			}

			$commentEndTag = $tokens[$i]['comment_closer'];

			$this->fixDocCommentCloseTags($phpCsFile, $commentEndTag);

			// We skip for multiline for now
			if ($tokens[$i]['line'] !== $tokens[$commentEndTag]['line']) {
				continue;
			}

			$typeTag = $this->_findTagIndex($tokens, $i, $commentEndTag, T_DOC_COMMENT_TAG);
			$contentTag = $this->_findTagIndex($tokens, $i, $commentEndTag, T_DOC_COMMENT_STRING);

			if ($typeTag === null || $contentTag === null) {
				$phpCsFile->addError('Invalid Inline Doc Block', $startIndex, 'DocBlockInvalid');
				return;
			}

			if ($tokens[$typeTag]['content'] !== '@var') {
				// We ignore those
				return;
			}

			$errors = $this->findErrors($phpCsFile, $contentTag);

			if (!$errors) {
				continue;
			}

			$fix = $phpCsFile->addFixableError('Invalid Inline Doc Block content: ' . implode(', ', $errors), $i, 'DocBlockContentInvalid');
			if (!$fix) {
				continue;
			}

			$phpCsFile->fixer->beginChangeset();

			$comment = $tokens[$contentTag]['content'];

			if (isset($errors['space-before-end']) || isset($errors['end'])) {
				$comment .= ' ';
			}

			if (isset($errors['order'])) {
				$comment = preg_replace('|^(.+?)\s+(.+?)\s*$|', '\2 \1 ', $comment);
			}

			$phpCsFile->fixer->replaceToken($contentTag, $comment);

			$phpCsFile->fixer->endChangeset();
		}
	}
795518
private function getHunkTokens(
        array $diffLineList,
        int &$currentLine
    ): array {
        $tokenList = [];
        $hunkTokens = $this->getHunkStartTokens($diffLineList[$currentLine]);

        // We have found a hunk start, process hunk lines
        if ($this->isHunkStart($hunkTokens)) {
            $currentLine++;

            [$originalLineCount, $newLineCount] = $this->getHunkLineCounts($hunkTokens);
            $addedCount = 0;
            $removedCount = 0;
            $unchangedCount = 0;

            // Iterate until we have the correct number of original & new lines
            $lineCount = count($diffLineList);
            for ($i = $currentLine; $i < $lineCount; $i++) {
                $tokenList[] = $this->getHunkLineToken(
                    $addedCount,
                    $removedCount,
                    $unchangedCount,
                    $diffLineList[$i]
                );

                // We have reached the line count for original & new versions of hunk
                if (
                    $removedCount + $unchangedCount === $originalLineCount
                    && $addedCount + $unchangedCount === $newLineCount
                ) {
                    break;
                }
            }
        }

        return array_merge($hunkTokens, $tokenList);
    }
541641
@Exported
    public boolean isOffline() {
        for (Node n : getNodes()) {
            Computer c = n.toComputer();
            if(c != null && !c.isOffline())
                return false;
        }
        return true;
    }
1280501
public function isLineNumberAffected($line)
    {
        // Added lines also affect the ones afterwards in conflict resolution,
        // because they are added in between.
        $bleed = ($this->type == self::ADDED ? 1 : 0);
        return ($line >= $this->start && $line <= $this->end + $bleed);
    }
963
private function isHeaderLine(string $line): bool
    {
        $matches = [];
        if (preg_match('#^diff --git [a|b|c|i|w|o]/(.*) [a|b|c|i|w|o]/(.*)#', $line, $matches)) {
            $this->appendCollectedFileAndChanges();
            $this->currentOperation = File::OP_MODIFIED;
            $this->currentFileName  = $matches[2];
            return true;
        }
        return false;
    }
952347
function isSingleLine(node) {
    return node.loc.start.line === node.loc.end.line
}
1224036
@Override
    public boolean isNewLine(byte[]bytes, int p, int end) {
        return p < end ? bytes[p] == Encoding.NEW_LINE : false;
    }
345634
protected function isSiblingItem($line)
	{
		$siblingMarker = $this->_nestedListTypes[$this->_listDepth] == 'ol' ? '*' : '#';
		if ($line[0] !== $siblingMarker) {
			return false;
		}
		return
			($siblingMarker === '#' && preg_match('/^#{' . $this->_listDepth . '}[^#]+/', $line)) ||
			($siblingMarker === '*' && preg_match('/^\*{' . $this->_listDepth . '}[^\*]+/', $line));
	}
521019
protected function startsWith($value, $line = null)
    {
        if (is_null($line)) {
            $line = $this->currentLine();
        }

        return (substr($line, 0, strlen($value)) === $value);
    }