Returns the real lines before the first use.

@param int $firstUsePos
@param int $posBeforeFirstUse

@return int
348741
private function getRealLinesBeforeFirstUse(int $firstUsePos, int $posBeforeFirstUse): int
    {
        $file = $this->getFile();
        $whitespaceBeforeFirstUse = '';

        if ($posBeforeFirstUse + 1 !== $firstUsePos) {
            $whitespaceBeforeFirstUse .= TokenHelper::getContent(
                $file,
                $posBeforeFirstUse + 1,
                $firstUsePos - 1
            );
        }

        return substr_count($whitespaceBeforeFirstUse, $file->eolChar) - 1;
    }
369740
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getDealerId();
                break;
            case 2:
                return $this->getDay();
                break;
            case 3:
                return $this->getBegin();
                break;
            case 4:
                return $this->getEnd();
                break;
            case 5:
                return $this->getClosed();
                break;
            case 6:
                return $this->getPeriodBegin();
                break;
            case 7:
                return $this->getPeriodEnd();
                break;
            case 8:
                return $this->getCreatedAt();
                break;
            case 9:
                return $this->getUpdatedAt();
                break;
            case 10:
                return $this->getVersion();
                break;
            case 11:
                return $this->getVersionCreatedAt();
                break;
            case 12:
                return $this->getVersionCreatedBy();
                break;
            case 13:
                return $this->getDealerIdVersion();
                break;
            default:
                return null;
                break;
        } // switch()
    }
578002
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getLogin();
                break;
            case 2:
                return $this->getNickname();
                break;
            case 3:
                return $this->getNicknameStripped();
                break;
            case 4:
                return $this->getPath();
                break;
            case 5:
                return $this->getWins();
                break;
            case 6:
                return $this->getOnlineTime();
                break;
            case 7:
                return $this->getLastOnline();
                break;
            default:
                return null;
                break;
        } // switch()
    }
992930
def _get_pos(self):
        
        if self._canvas.height >= self._max_height:
            return 0
        else:
            return self._canvas.start_line / (self._max_height - self._canvas.height + 1)
1059330
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getName();
                break;
            case 2:
                return $this->getStreet();
                break;
            case 3:
                return $this->getZip();
                break;
            case 4:
                return $this->getCity();
                break;
            case 5:
                return $this->getCountryId();
                break;
            case 6:
                return $this->getPhone();
                break;
            case 7:
                return $this->getFax();
                break;
            case 8:
                return $this->getEmail();
                break;
            case 9:
                return $this->getLegalform();
                break;
            case 10:
                return $this->getLogo();
                break;
            case 11:
                return $this->getCreated();
                break;
            case 12:
                return $this->getNotes();
                break;
            default:
                return null;
                break;
        } // switch()
    }
560636
private function checkLinesBetweenDescriptionAndFirstAnnotation(
        int $startPointer,
        int $endPointer,
        ?Annotation $firstAnnotation
    ) {
        if ($firstAnnotation === null || $startPointer === $firstAnnotation->getStartPointer()) {
            return;
        }

        \preg_match('~(\\s+)$~', $this->tokens[$endPointer]['content'], $matches);

        $lines = $matches[1] ?? '';
        $lines .= TokenHelper::getContent(
            $this->phpcsFile,
            $endPointer + 1,
            $firstAnnotation->getStartPointer() - 1
        );

        $linesCount = $this->countLines($lines);

        if ($linesCount === 1) {
            return;
        }

        $this->phpcsFile->addError(
            \sprintf('Expected 1 lines between description and annotations, found %d.', $linesCount),
            $firstAnnotation->getStartPointer(),
            'LinesBetweenDescriptionAndFirstAnnotation'
        );
    }
834106
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getFirstName();
                break;
            case 2:
                return $this->getLastName();
                break;
            case 3:
                return $this->getCreatedAt();
                break;
            case 4:
                return $this->getUpdatedAt();
                break;
            case 5:
                return $this->getVersion();
                break;
            case 6:
                return $this->getVersionCreatedAt();
                break;
            case 7:
                return $this->getVersionCreatedBy();
                break;
            case 8:
                return $this->getPersonTeamLinkIds();
                break;
            case 9:
                return $this->getPersonTeamLinkVersions();
                break;
            case 10:
                return $this->getPersonImageIds();
                break;
            case 11:
                return $this->getPersonImageVersions();
                break;
            case 12:
                return $this->getPersonFunctionLinkIds();
                break;
            case 13:
                return $this->getPersonFunctionLinkVersions();
                break;
            default:
                return null;
                break;
        } // switch()
    }
672707
@SuppressWarnings("PointlessArithmeticExpression")
    int getDataFirstRecord(final int territoryNumber) {
        assert (0 <= territoryNumber) && (territoryNumber <= Territory.AAA.getNumber());
        return index[territoryNumber + POS_INDEX_FIRST_RECORD];
    }
1084881
private function fixLinesBetweenUses(int $usePos, int $previousUseEndPos): void
    {
        $file = $this->getFile();

        $posBeforeIndentation = TokenHelper::findPreviousContent(
            $file,
            T_WHITESPACE,
            $file->eolChar,
            $usePos,
            $previousUseEndPos
        );

        $file->fixer->beginChangeset();
        if ($posBeforeIndentation !== null) {
            for ($i = $previousUseEndPos + 1; $i <= $posBeforeIndentation; $i++) {
                $file->fixer->replaceToken($i, '');
            }
        }
        for ($i = 0; $i <= self::LINES_BETWEEN_USES; $i++) {
            $file->fixer->addNewline($previousUseEndPos);
        }
        $file->fixer->endChangeset();
    }
874113
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getSlug();
                break;
            case 2:
                return $this->getHasAttributeAvValue();
                break;
            case 3:
                return $this->getIsMultilingualAttributeAvValue();
                break;
            case 4:
                return $this->getPattern();
                break;
            case 5:
                return $this->getCssClass();
                break;
            case 6:
                return $this->getInputType();
                break;
            case 7:
                return $this->getMax();
                break;
            case 8:
                return $this->getMin();
                break;
            case 9:
                return $this->getStep();
                break;
            case 10:
                return $this->getImageMaxWidth();
                break;
            case 11:
                return $this->getImageMaxHeight();
                break;
            case 12:
                return $this->getImageRatio();
                break;
            case 13:
                return $this->getCreatedAt();
                break;
            case 14:
                return $this->getUpdatedAt();
                break;
            default:
                return null;
                break;
        } // switch()
    }
1193803
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getUserId();
                break;
            case 2:
                return $this->getCustomerId();
                break;
            default:
                return null;
                break;
        } // switch()
    }
353024
protected function firstLines($lineCount=20)
    {
        if ($this->firstLines !== null) {
            return $this->firstLines;
        }

        $this->firstLines = $this->convertEncoding($this->firstLinesRaw($lineCount));

        return $this->firstLines;

    }
1134779
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getTitle();
                break;
            case 2:
                return $this->getSlug();
                break;
            case 3:
                return $this->getSportId();
                break;
            case 4:
                return $this->getDescription();
                break;
            default:
                return null;
                break;
        } // switch()
    }
1096044
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getAttributeAvId();
                break;
            case 2:
                return $this->getAttributeAttributeTypeId();
                break;
            case 3:
                return $this->getLocale();
                break;
            case 4:
                return $this->getValue();
                break;
            case 5:
                return $this->getCreatedAt();
                break;
            case 6:
                return $this->getUpdatedAt();
                break;
            default:
                return null;
                break;
        } // switch()
    }
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;
    }
512930
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getUsername();
                break;
            case 2:
                return $this->getPassword();
                break;
            case 3:
                return $this->getFirstName();
                break;
            case 4:
                return $this->getLastName();
                break;
            case 5:
                return $this->getCreateDate();
                break;
            case 6:
                return $this->getUpdateDate();
                break;
            case 7:
                return $this->getStatus();
                break;
            default:
                return null;
                break;
        } // switch()
    }
1234354
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getFeatureAvId();
                break;
            case 2:
                return $this->getFeatureFeatureTypeId();
                break;
            case 3:
                return $this->getLocale();
                break;
            case 4:
                return $this->getValue();
                break;
            case 5:
                return $this->getCreatedAt();
                break;
            case 6:
                return $this->getUpdatedAt();
                break;
            default:
                return null;
                break;
        } // switch()
    }