Sorts the paths so that the most specific paths are listed first.

@return array
962844
private function sortPaths()
    {
        $this->normalizePaths();

        uasort($this->paths, function ($a, $b) {
            if ($a == $b) {
                return 0;
            }

            return (substr_count($a['path'], DIRECTORY_SEPARATOR) >
                substr_count($b['path'], DIRECTORY_SEPARATOR)) ? -1 : 1;
        });

        return $this->paths;
    }
1162061
protected function prioritseCandidates()
    {
        $requestParts       = array();

        // Turn numeric request parts into integers
        foreach (explode('/', $this->request->getPathInfo()) as $part) {
            if (is_numeric($part)) {
                $requestParts[] = (int) $part;
            } else {
                $requestParts[] = $part;
            }
        }

        foreach ($this->candidates as $key => $route) {
            $isCandidate    = true;
            $priority       = 0;

            $this->establishPriority(count($route->getRequirements()));

            // Remove from candidates list those Routes that Method does not match Request method
            if (!in_array($this->request->getMethod(), $route->getMethods())) {
                $isCandidate = false;
            }

            $routeParts = explode('/', $route->getPath());

            foreach ($route->getRequirements() as $requirement => $type) {
                $pattern = '{' . $requirement . '}';
                $key = array_search($pattern, $routeParts);
                $part = $routeParts[$key];

                if (preg_match('/^\{\w+\}/', $part)) {
                    if ($type == 'int') {
                        if (is_numeric($requestParts[$key])) {
                            $priority ++;
                        }
                    } elseif ($type == 'str') {
                        if (is_string($requestParts[$key])) {
                            $priority ++;
                        }
                    }
                }

            }

            if ($isCandidate) {
                $this->prioritised[$priority][] = $route;
            }
        }
    }
1162561
protected function paths()
    {
        $finder = $this->laravel['view']->getFinder();

        return collect($finder->getPaths())->merge(
            collect($finder->getHints())->flatten()
        );
    }
84287
public function getListSorting()
    {
        $aListSorting = parent::getListSorting();

        if (array_keys($aListSorting['oxcountry']) === ['oxactive']) {
            $aListSorting['oxcountry'][$this->_getSecondSortFieldName()] = 'asc';
        }

        return $aListSorting;
    }
784612
public function getScanPaths() : array
    {
        $paths = $this->paths;

        $paths[] = $this->getPath();

        if ($this->config('scan.enabled')) {
            $paths = array_merge($paths, $this->config('scan.paths'));
        }

        $paths = array_map(function ($path) {
            return Str::endsWith($path, '/*') ? $path : Str::finish($path, '/*');
        }, $paths);

        return $paths;
    }
1018591
public function onSetSorting()
    {
        $sortBy = Input::get('sortBy', $this->getSortBy());
        $sortDirection = Input::get('sortDirection', $this->getSortDirection());
        $path = Input::get('path');

        $this->setSortBy($sortBy);
        $this->setSortDirection($sortDirection);
        $this->setCurrentFolder($path);

        $this->prepareVars();

        return [
            '#'.$this->getId('item-list') => $this->makePartial('item-list'),
            '#'.$this->getId('folder-path') => $this->makePartial('folder-path')
        ];
    }
1285801
public function getTopLevelSections()
    {
        $this->sortSectionsByDepth();
        $topLevelSections = array();

        foreach ($this->sections as $section) {
            if ($section->getDepth() != 0) {
                break;
            }
            $topLevelSections[] = $section;
        }

        return $topLevelSections;
    }
243909
public function getScanPaths()
    {
        $paths = $this->paths;

        $paths[] = $this->getPath().'/*';

        if ($this->config('scan.enabled')) {
            $paths = array_merge($paths, $this->config('scan.paths'));
        }

        return $paths;
    }
526547
public function getSortedRefs()
    {
        $versions = $this->versions;

        usort($versions, function (version $v1, version $v2) {


            return version::gt($v1, $v2) ? -1 : 1;
        });

        $versions = array_map(function (version $v) {


            return $v->getVersion();
        }, $versions);

        return array_merge($this->branches, $versions);
    }
1082574
protected function getMigrationPaths()
    {
        // Here, we will check to see if a path option has been defined. If it has we will
        // use the path relative to the root of the installation folder so our database
        // migrations may be run for any customized path from within the application.
        if ($this->input->hasOption('path') && $this->option('path')) {
            return [root_path($this->option('path'))];
        }

        return array_merge(
            [$this->getMigrationPath()],
            $this->container['migrator']->paths()
        );
    }
649169
public function getSorters()
    {
        $sorters = &gplcart_static('module.file_manager.sorter.list');

        if (isset($sorters)) {
            return $sorters;
        }

        $sorters = (array) gplcart_config_get(__DIR__ . '/../config/sorters.php');
        $this->hook->attach('module.file_manager.sorter.list', $sorters, $this);
        return $sorters;
    }
892148
public function getDefaultSorting()
    {
        $aSorting = parent::getDefaultSorting();

        $oCategory = $this->getActiveCategory();

        if ($this->getListType() != 'search' && $oCategory && $oCategory instanceof \OxidEsales\Eshop\Application\Model\Category) {
            if ($sSortBy = $oCategory->getDefaultSorting()) {
                $sSortDir = ($oCategory->getDefaultSortingMode()) ? "desc" : "asc";
                $aSorting = ['sortby' => $sSortBy, 'sortdir' => $sSortDir];
            }
        }

        return $aSorting;
    }
880529
protected function getPaths()
    {
        if (!$this->paths) {
            $this->paths = new PriorityQueue();

            $this->registerPaths();
        }

        return $this->paths;
    }
280180
public function getSortedList()
    {
        $this->addVariables();

        // Find all items that don't have their order specified by the config system
        $unspecified = array_diff($this->names, $this->priorities);

        if (!empty($unspecified)) {
            $this->includeRest($unspecified);
        }

        $sortedList = [];
        foreach ($this->priorities as $itemName) {
            if (isset($this->items[$itemName])) {
                $sortedList[$itemName] = $this->items[$itemName];
            }
        }

        return $sortedList;
    }
1064891
public function getSortNext()
	{
		$defaultSort = $this->grid->getColumnDefaultSort($this->key);

		if ($this->sort == 'ASC') {
			return [$this->key => $defaultSort === 'DESC' ? FALSE : 'DESC'];
		} else if ($this->sort == 'DESC') {
			return [$this->key => $defaultSort === 'DESC' ? 'ASC' : FALSE];
		}

		return [$this->key => 'ASC'];
	}
806473
public function getSorts()
    {
        $sortInput = $this->request->input($this->sortName, '');

        $sortFields = $this->collection->make(
            is_array($sortInput) ? $sortInput :
                explode($this->sortFieldsSeparator, $sortInput));

        $sorts = $this->collection->make();

        $sortFields->each(function ($field) use ($sorts) {
            $s = new Sort();
            $order = 'ASC';

            if (starts_with($field, $this->sortDescSign)) {
                $order = 'DESC';
                $field = mb_substr($field, mb_strlen($this->sortDescSign));
            }

            if ($field = trim($field)) {
                $s->setField($field);
                $s->setOrder($order);
                $sorts->put($field, $s);
            }
        });

        return $sorts->values();
    }
13088
private function prepareSortOrders()
    {
        $sortOrders = [];

        foreach ($this->_orders as $attribute => $direction) {
            $sortParams = ['direction' => $direction];
            $sortField = $attribute;
            $sortOrders[$sortField] = $sortParams;
        }

        return $sortOrders;
    }