PhpCsFixer\Fixer\Import\OrderedImportsFixer::sortingCallBack PHP Method

sortingCallBack() public static method

This method is used for sorting the uses in a namespace.
public static sortingCallBack ( array $first, array $second ) : integer
$first array
$second array
return integer
    public static function sortingCallBack(array $first, array $second)
    {
        if ($first['importType'] !== $second['importType']) {
            return $first['importType'] > $second['importType'] ? 1 : -1;
        }
        $firstNamespace = trim(preg_replace('%/\\*(.*)\\*/%s', '', $first['namespace']));
        $secondNamespace = trim(preg_replace('%/\\*(.*)\\*/%s', '', $second['namespace']));
        // Replace backslashes by spaces before sorting for correct sort order
        return strcasecmp(str_replace('\\', ' ', $firstNamespace), str_replace('\\', ' ', $secondNamespace));
    }