ApiGen\Parser\Elements\GroupSorter::compareGroups PHP Метод

compareGroups() приватный метод

private compareGroups ( string $one, string $two, string $main ) : integer
$one string
$two string
$main string
Результат integer
    private function compareGroups($one, $two, $main)
    {
        // \ as separator has to be first
        $one = str_replace('\\', ' ', $one);
        $two = str_replace('\\', ' ', $two);
        if ($main) {
            if (strpos($one, $main) === 0 && strpos($two, $main) !== 0) {
                return -1;
            } elseif (strpos($one, $main) !== 0 && strpos($two, $main) === 0) {
                return 1;
            }
        }
        return strcasecmp($one, $two);
    }