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

        $prevParts = explode(NamespaceHelper::NAMESPACE_SEPARATOR, $prevStatement->getFullyQualifiedTypeName());
        $nextParts = explode(NamespaceHelper::NAMESPACE_SEPARATOR, $nextStatement->getFullyQualifiedTypeName());

        $minPartsCount = min(count($prevParts), count($nextParts));

        for ($i = 0; $i < $minPartsCount; ++$i) {
            $comparison = strcasecmp($prevParts[$i], $nextParts[$i]);

            if ($comparison) {
                $compareByContent = $comparison;
                break;
            }
        }

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

        $prevParts = explode(NamespaceHelper::NAMESPACE_SEPARATOR, $prevStatement->getFullyQualifiedTypeName());
        $nextParts = explode(NamespaceHelper::NAMESPACE_SEPARATOR, $nextStatement->getFullyQualifiedTypeName());

        $minPartsCount = min(count($prevParts), count($nextParts));

        for ($i = 0; $i < $minPartsCount; ++$i) {
            $comparison = strcasecmp($prevParts[$i], $nextParts[$i]);

            if ($comparison) {
                $compareByContent = $comparison;
                break;
            }
        }

        return $compareByContent;
    }
private function compareUseStatementsByContent ( UseStatement $ prevStatement , UseStatement $ nextStatement ) : ? int { $ compareByContent = null ; $ prevParts = explode ( NamespaceHelper :: NAMESPACE_SEPARATOR , $ prevStatement -> getFullyQualifiedTypeName ( ) ) ; $ nextParts = explode ( NamespaceHelper :: NAMESPACE_SEPARATOR , $ nextStatement -> getFullyQualifiedTypeName ( ) ) ; $ minPartsCount = min ( count ( $ prevParts ) , count ( $ nextParts ) ) ; for ( $ i = 0 ; $ i < $ minPartsCount ; ++ $ i ) { $ comparison = strcasecmp ( $ prevParts [ $ i ] , $ nextParts [ $ i ] ) ; if ( $ comparison ) { $ compareByContent = $ comparison ; break ; } } return $ compareByContent ; }
Compares the given use statements by their string content.

@SuppressWarnings(PHPMD.UnusedPrivateMethod)

@param UseStatement $prevStatement
@param UseStatement $nextStatement

@return int|null 1 <=> -1 To move statements in a direction.
Compares the given use statements by their string content .