public function getSortedVersions($descending = false, $developmentVersionsFirst = null)
    {
        if ($developmentVersionsFirst === null) {
            $versionComparer = new VersionComparer();
            $result = $versionComparer->sortPackageVersionEntities($this->getVersions()->toArray(), $descending);
        } else {
            $devVersions = $this->getSortedDevelopmentVersions($descending);
            $prodVersions = $this->getSortedProductionVersions($descending);
            if ($developmentVersionsFirst) {
                $result = array_merge($devVersions, $prodVersions);
            } else {
                $result = array_merge($prodVersions, $devVersions);
            }
        }

        return $result;
    }
public function getSortedVersions($descending = false, $developmentVersionsFirst = null)
    {
        if ($developmentVersionsFirst === null) {
            $versionComparer = new VersionComparer();
            $result = $versionComparer->sortPackageVersionEntities($this->getVersions()->toArray(), $descending);
        } else {
            $devVersions = $this->getSortedDevelopmentVersions($descending);
            $prodVersions = $this->getSortedProductionVersions($descending);
            if ($developmentVersionsFirst) {
                $result = array_merge($devVersions, $prodVersions);
            } else {
                $result = array_merge($prodVersions, $devVersions);
            }
        }

        return $result;
    }
public function getSortedVersions ( $ descending = false , $ developmentVersionsFirst = null ) { if ( $ developmentVersionsFirst === null ) { $ versionComparer = new VersionComparer ( ) ; $ result = $ versionComparer -> sortPackageVersionEntities ( $ this -> getVersions ( ) -> toArray ( ) , $ descending ) ; } else { $ devVersions = $ this -> getSortedDevelopmentVersions ( $ descending ) ; $ prodVersions = $ this -> getSortedProductionVersions ( $ descending ) ; if ( $ developmentVersionsFirst ) { $ result = array_merge ( $ devVersions , $ prodVersions ) ; } else { $ result = array_merge ( $ prodVersions , $ devVersions ) ; } } return $ result ; }
Get the versions, sorted in ascending or descending order, with development or production versions first.

@param bool $descending
@param bool|null $developmentVersionsFirst If null, development versions are placed among the production versions

@return Package\Version[]
Get the versions sorted in ascending or descending order with development or production versions first .