src/Standards/BestIt/Sniffs/Formatting/TraitUseSpacingSniff.php
private function fixLinesBeforeFirstUse(
        int $firstUsePos,
        int $posBeforeFirstUse
    ): void {
        $file = $this->getFile();
        $file->fixer->beginChangeset();

        $posBeforeIndentation = TokenHelper::findPreviousContent(
            $file,
            T_WHITESPACE,
            $file->eolChar,
            $firstUsePos,
            $posBeforeFirstUse
        );

        if ($posBeforeIndentation !== null) {
            for ($i = $posBeforeFirstUse + 1; $i <= $posBeforeIndentation; $i++) {
                $file->fixer->replaceToken($i, '');
            }
        }
        for ($i = 0; $i <= self::LINES_BEFORE_FIRST_USE; $i++) {
            $file->fixer->addNewline($posBeforeFirstUse);
        }

        $file->fixer->endChangeset();
    }
private function fixLinesBeforeFirstUse(
        int $firstUsePos,
        int $posBeforeFirstUse
    ): void {
        $file = $this->getFile();
        $file->fixer->beginChangeset();

        $posBeforeIndentation = TokenHelper::findPreviousContent(
            $file,
            T_WHITESPACE,
            $file->eolChar,
            $firstUsePos,
            $posBeforeFirstUse
        );

        if ($posBeforeIndentation !== null) {
            for ($i = $posBeforeFirstUse + 1; $i <= $posBeforeIndentation; $i++) {
                $file->fixer->replaceToken($i, '');
            }
        }
        for ($i = 0; $i <= self::LINES_BEFORE_FIRST_USE; $i++) {
            $file->fixer->addNewline($posBeforeFirstUse);
        }

        $file->fixer->endChangeset();
    }
private function fixLinesBeforeFirstUse ( int $ firstUsePos , int $ posBeforeFirstUse ) : void { $ file = $ this -> getFile ( ) ; $ file -> fixer -> beginChangeset ( ) ; $ posBeforeIndentation = TokenHelper :: findPreviousContent ( $ file , T_WHITESPACE , $ file -> eolChar , $ firstUsePos , $ posBeforeFirstUse ) ; if ( $ posBeforeIndentation !== null ) { for ( $ i = $ posBeforeFirstUse + 1 ; $ i <= $ posBeforeIndentation ; $ i ++ ) { $ file -> fixer -> replaceToken ( $ i , '' ) ; } } for ( $ i = 0 ; $ i <= self :: LINES_BEFORE_FIRST_USE ; $ i ++ ) { $ file -> fixer -> addNewline ( $ posBeforeFirstUse ) ; } $ file -> fixer -> endChangeset ( ) ; }
Fixes the lines before the first use.

@param int $firstUsePos
@param int $posBeforeFirstUse

@return void
Fixes the lines before the first use .