src/Rocketeer/Services/Releases/ReleasesManager.php
public function getPreviousRelease($release = null)
    {
        // Get all releases and the current one
        $releases = $this->getReleases();
        $current = $release ?: $this->getCurrentRelease();

        // Get the one before that, or default to current
        $key = array_search($current, $releases, true);
        $key = !is_int($key) ? -1 : $key;
        $next = 1;
        do {
            $release = Arr::get($releases, $key + $next);
            ++$next;
        } while (!$this->checkReleaseState($release) && isset($this->state[$release]));

        return $release ?: $current;
    }
public function getPreviousRelease($release = null)
    {
        // Get all releases and the current one
        $releases = $this->getReleases();
        $current = $release ?: $this->getCurrentRelease();

        // Get the one before that, or default to current
        $key = array_search($current, $releases, true);
        $key = !is_int($key) ? -1 : $key;
        $next = 1;
        do {
            $release = Arr::get($releases, $key + $next);
            ++$next;
        } while (!$this->checkReleaseState($release) && isset($this->state[$release]));

        return $release ?: $current;
    }
public function getPreviousRelease ( $ release = null ) { // Get all releases and the current one $ releases = $ this -> getReleases ( ) ; $ current = $ release ? : $ this -> getCurrentRelease ( ) ; // Get the one before that, or default to current $ key = array_search ( $ current , $ releases , true ) ; $ key = ! is_int ( $ key ) ? - 1 : $ key ; $ next = 1 ; do { $ release = Arr :: get ( $ releases , $ key + $ next ) ; ++ $ next ; } while ( ! $ this -> checkReleaseState ( $ release ) && isset ( $ this -> state [ $ release ] ) ) ; return $ release ? : $ current ; }
Get the release before the current one.

@param string|null $release A release name

@return string
Get the release before the current one .