src/Standards/BestIt/Sniffs/Formatting/AlphabeticallySortedUsesSniff.php
protected function processToken(): void
    {
        $prevStatement = null;

        foreach ($this->useStatements as $useStatement) {
            if ($prevStatement && ($this->compareUseStatements($prevStatement, $useStatement) > 0)) {
                $exception = new CodeError(
                    static::CODE_INCORRECT_ORDER,
                    'Use statements should be sorted alphabetically. The first wrong one is %s.',
                    $useStatement->getPointer()
                );

                $exception
                    ->setPayload([$useStatement->getFullyQualifiedTypeName()])
                    ->isFixable(true);

                throw $exception;
            }

            $prevStatement = $useStatement;
        }
    }
protected function processToken(): void
    {
        $prevStatement = null;

        foreach ($this->useStatements as $useStatement) {
            if ($prevStatement && ($this->compareUseStatements($prevStatement, $useStatement) > 0)) {
                $exception = new CodeError(
                    static::CODE_INCORRECT_ORDER,
                    'Use statements should be sorted alphabetically. The first wrong one is %s.',
                    $useStatement->getPointer()
                );

                $exception
                    ->setPayload([$useStatement->getFullyQualifiedTypeName()])
                    ->isFixable(true);

                throw $exception;
            }

            $prevStatement = $useStatement;
        }
    }
protected function processToken ( ) : void { $ prevStatement = null ; foreach ( $ this -> useStatements as $ useStatement ) { if ( $ prevStatement && ( $ this -> compareUseStatements ( $ prevStatement , $ useStatement ) > 0 ) ) { $ exception = new CodeError ( static :: CODE_INCORRECT_ORDER , 'Use statements should be sorted alphabetically. The first wrong one is %s.' , $ useStatement -> getPointer ( ) ) ; $ exception -> setPayload ( [ $ useStatement -> getFullyQualifiedTypeName ( ) ] ) -> isFixable ( true ) ; throw $ exception ; } $ prevStatement = $ useStatement ; } }
Checks if the uses are in the correct order.

@throws CodeError

@return void
Checks if the uses are in the correct order .