src/Standards/BestIt/Sniffs/Formatting/AlphabeticallySortedUsesSniff.php
private function compareUseStatementsByType(UseStatement $prevStatement, UseStatement $nextStatement): ?int
    {
        $comparedByType = null;

        if (!$prevStatement->hasSameType($nextStatement)) {
            $order = [
                UseStatement::TYPE_DEFAULT => 1,
                UseStatement::TYPE_FUNCTION => 2,
                UseStatement::TYPE_CONSTANT => 3,
            ];

            $file = $this->getFile();
            $comparedByType = $order[UseStatementHelper::getType($file, $prevStatement)] <=>
                $order[UseStatementHelper::getType($file, $nextStatement)];
        }

        return $comparedByType;
    }
private function compareUseStatementsByType(UseStatement $prevStatement, UseStatement $nextStatement): ?int
    {
        $comparedByType = null;

        if (!$prevStatement->hasSameType($nextStatement)) {
            $order = [
                UseStatement::TYPE_DEFAULT => 1,
                UseStatement::TYPE_FUNCTION => 2,
                UseStatement::TYPE_CONSTANT => 3,
            ];

            $file = $this->getFile();
            $comparedByType = $order[UseStatementHelper::getType($file, $prevStatement)] <=>
                $order[UseStatementHelper::getType($file, $nextStatement)];
        }

        return $comparedByType;
    }
private function compareUseStatementsByType ( UseStatement $ prevStatement , UseStatement $ nextStatement ) : ? int { $ comparedByType = null ; if ( ! $ prevStatement -> hasSameType ( $ nextStatement ) ) { $ order = [ UseStatement :: TYPE_DEFAULT => 1 , UseStatement :: TYPE_FUNCTION => 2 , UseStatement :: TYPE_CONSTANT => 3 , ] ; $ file = $ this -> getFile ( ) ; $ comparedByType = $ order [ UseStatementHelper :: getType ( $ file , $ prevStatement ) ] <=> $ order [ UseStatementHelper :: getType ( $ file , $ nextStatement ) ] ; } return $ comparedByType ; }
Classes to the top, functions next, constants last.

@SuppressWarnings(PHPMD.UnusedPrivateMethod)

@param UseStatement $prevStatement
@param UseStatement $nextStatement

@return int|null 1 <=> -1 To move statements in a direction.
Classes to the top functions next constants last .