src/Standards/BestIt/Sniffs/Formatting/TraitUseDeclarationSniff.php
protected function fixeUse(int $endPos, int $usePos): void
    {
        $indentation = $this->getIndentationForFix($usePos);
        $file = $this->getFile()->getBaseFile();
        $fixer = $file->fixer;

        $fixer->beginChangeset();

        $commaPointers = TokenHelper::findNextAll($file, T_COMMA, $usePos + 1, $endPos);
        foreach ($commaPointers as $commaPos) {
            $pointerAfterComma = TokenHelper::findNextEffective($file, $commaPos + 1);
            $fixer->replaceToken($commaPos, ';' . $file->eolChar . $indentation . 'use ');
            for ($i = $commaPos + 1; $i < $pointerAfterComma; $i++) {
                $fixer->replaceToken($i, '');
            }
        }

        $fixer->endChangeset();
    }
protected function fixeUse(int $endPos, int $usePos): void
    {
        $indentation = $this->getIndentationForFix($usePos);
        $file = $this->getFile()->getBaseFile();
        $fixer = $file->fixer;

        $fixer->beginChangeset();

        $commaPointers = TokenHelper::findNextAll($file, T_COMMA, $usePos + 1, $endPos);
        foreach ($commaPointers as $commaPos) {
            $pointerAfterComma = TokenHelper::findNextEffective($file, $commaPos + 1);
            $fixer->replaceToken($commaPos, ';' . $file->eolChar . $indentation . 'use ');
            for ($i = $commaPos + 1; $i < $pointerAfterComma; $i++) {
                $fixer->replaceToken($i, '');
            }
        }

        $fixer->endChangeset();
    }
protected function fixeUse ( int $ endPos , int $ usePos ) : void { $ indentation = $ this -> getIndentationForFix ( $ usePos ) ; $ file = $ this -> getFile ( ) -> getBaseFile ( ) ; $ fixer = $ file -> fixer ; $ fixer -> beginChangeset ( ) ; $ commaPointers = TokenHelper :: findNextAll ( $ file , T_COMMA , $ usePos + 1 , $ endPos ) ; foreach ( $ commaPointers as $ commaPos ) { $ pointerAfterComma = TokenHelper :: findNextEffective ( $ file , $ commaPos + 1 ) ; $ fixer -> replaceToken ( $ commaPos , ';' . $ file -> eolChar . $ indentation . 'use ' ) ; for ( $ i = $ commaPos + 1 ; $ i < $ pointerAfterComma ; $ i ++ ) { $ fixer -> replaceToken ( $ i , '' ) ; } } $ fixer -> endChangeset ( ) ; }
Fixes the given use position.

@param int $endPos The end of the checked position.
@param int $usePos

@return void
Fixes the given use position .