src/Api/ApiProvider.php
private function buildVersionsList($service)
    {
        $dir = "{$this->modelsDir}/{$service}/";

        if (!is_dir($dir)) {
            return;
        }

        // Get versions, remove . and .., and sort in descending order.
        $results = array_diff(scandir($dir, SCANDIR_SORT_DESCENDING), ['..', '.']);

        if (!$results) {
            $this->manifest[$service] = ['versions' => []];
        } else {
            $this->manifest[$service] = [
                'versions' => [
                    'latest' => $results[0]
                ]
            ];
            $this->manifest[$service]['versions'] += array_combine($results, $results);
        }
    }
private function buildVersionsList($service)
    {
        $dir = "{$this->modelsDir}/{$service}/";

        if (!is_dir($dir)) {
            return;
        }

        // Get versions, remove . and .., and sort in descending order.
        $results = array_diff(scandir($dir, SCANDIR_SORT_DESCENDING), ['..', '.']);

        if (!$results) {
            $this->manifest[$service] = ['versions' => []];
        } else {
            $this->manifest[$service] = [
                'versions' => [
                    'latest' => $results[0]
                ]
            ];
            $this->manifest[$service]['versions'] += array_combine($results, $results);
        }
    }
private function buildVersionsList ( $ service ) { $ dir = "{$this->modelsDir}/{$service}/" ; if ( ! is_dir ( $ dir ) ) { return ; } // Get versions, remove . and .., and sort in descending order. $ results = array_diff ( scandir ( $ dir , SCANDIR_SORT_DESCENDING ) , [ '..' , '.' ] ) ; if ( ! $ results ) { $ this -> manifest [ $ service ] = [ 'versions' => [ ] ] ; } else { $ this -> manifest [ $ service ] = [ 'versions' => [ 'latest' => $ results [ 0 ] ] ] ; $ this -> manifest [ $ service ] [ 'versions' ] += array_combine ( $ results , $ results ) ; } }
Build the versions list for the specified service by globbing the dir.
Build the versions list for the specified service by globbing the dir .