protected static function sortApiVersions(array $versions = []): array
    {
        usort($versions, function ($first, $second) {
            $firstVersion = (float)$first['number'];
            $secondVersion = (float)$second['number'];

            if ($firstVersion == $secondVersion) {
                return 0;
            }

            return ($firstVersion > $secondVersion) ? 1 : -1;
        });

        return $versions;
    }
protected static function sortApiVersions(array $versions = []): array
    {
        usort($versions, function ($first, $second) {
            $firstVersion = (float)$first['number'];
            $secondVersion = (float)$second['number'];

            if ($firstVersion == $secondVersion) {
                return 0;
            }

            return ($firstVersion > $secondVersion) ? 1 : -1;
        });

        return $versions;
    }
protected static function sortApiVersions ( array $ versions = [ ] ) : array { usort ( $ versions , function ( $ first , $ second ) { $ firstVersion = ( float ) $ first [ 'number' ] ; $ secondVersion = ( float ) $ second [ 'number' ] ; if ( $ firstVersion == $ secondVersion ) { return 0 ; } return ( $ firstVersion > $ secondVersion ) ? 1 : - 1 ; } ) ; return $ versions ; }
Sorting API Versions ascendingly

@param mixed[] $versions of found API sub-directories

@return mixed[] $versions sorted in ascending order.
Sorting API Versions ascendingly