src/Standards/BestIt/Sniffs/Formatting/AlphabeticallySortedUsesSniff.php
private function compareUseStatementsByNamespaceCount(
        UseStatement $prevStatement,
        UseStatement $nextStatement
    ): int {
        $aNameParts = explode(NamespaceHelper::NAMESPACE_SEPARATOR, $prevStatement->getFullyQualifiedTypeName());
        $bNameParts = explode(NamespaceHelper::NAMESPACE_SEPARATOR, $nextStatement->getFullyQualifiedTypeName());

        return count($aNameParts) <=> count($bNameParts);
    }
private function compareUseStatementsByNamespaceCount(
        UseStatement $prevStatement,
        UseStatement $nextStatement
    ): int {
        $aNameParts = explode(NamespaceHelper::NAMESPACE_SEPARATOR, $prevStatement->getFullyQualifiedTypeName());
        $bNameParts = explode(NamespaceHelper::NAMESPACE_SEPARATOR, $nextStatement->getFullyQualifiedTypeName());

        return count($aNameParts) <=> count($bNameParts);
    }
private function compareUseStatementsByNamespaceCount ( UseStatement $ prevStatement , UseStatement $ nextStatement ) : int { $ aNameParts = explode ( NamespaceHelper :: NAMESPACE_SEPARATOR , $ prevStatement -> getFullyQualifiedTypeName ( ) ) ; $ bNameParts = explode ( NamespaceHelper :: NAMESPACE_SEPARATOR , $ nextStatement -> getFullyQualifiedTypeName ( ) ) ; return count ( $ aNameParts ) <=> count ( $ bNameParts ) ; }
The shorted usage comes at top.

@SuppressWarnings(PHPMD.UnusedPrivateMethod)

@param UseStatement $prevStatement
@param UseStatement $nextStatement

@return int 1 <=> -1 To move statements in a direction.
The shorted usage comes at top .