src/Version.php
public function getNextVersionCandidates(): array
    {
        $candidates = [];

        // Pre first-stable, so 0.x-[rc,beta,stable] releases are not considered.
        // Use alpha as stability with metaver 1, 0.2-alpha2 is simple ignored.
        // If anyone really uses this... not our problem :)
        if (0 === $this->major) {
            $candidates[] = $this->getNextIncreaseOf('patch');
            $candidates[] = $this->getNextIncreaseOf('minor');
            $candidates[] = self::fromString('1.0.0-BETA1');

            // stable (RC usually follows *after* beta, but jumps to stable are accepted)
            // RC is technically valid, but not very common and therefor ignored.
            $candidates[] = self::fromString('1.0.0');

            return $candidates;
        }

        // Latest is unstable, may increase stability or metaver (nothing else)
        // 1.0.1-beta1 is not accepted, an (un)stability only applies for x.0.0
        if ($this->stability < self::STABILITY_STABLE) {
            $candidates[] = new self($this->major, $this->minor, 0, $this->stability, $this->metaver + 1);

            for ($s = $this->stability + 1; $s < 3; ++$s) {
                $candidates[] = new self($this->major, $this->minor, 0, $s, 1);
            }

            $candidates[] = new self($this->major, $this->minor, 0, self::STABILITY_STABLE);

            return $candidates;
        }

        // Stable, so a patch, major or new minor (with lower stability) version is possible, RC is excluded.
        $candidates[] = $this->getNextIncreaseOf('patch');
        $candidates[] = $this->getNextIncreaseOf('beta');
        $candidates[] = $this->getNextIncreaseOf('minor');

        // New (un)stable major (excluding RC)
        $candidates[] = new self($this->major + 1, 0, 0, self::STABILITY_ALPHA, 1);
        $candidates[] = new self($this->major + 1, 0, 0, self::STABILITY_BETA, 1);
        $candidates[] = new self($this->major + 1, 0, 0, self::STABILITY_STABLE);

        return $candidates;
    }
public function getNextVersionCandidates(): array
    {
        $candidates = [];

        // Pre first-stable, so 0.x-[rc,beta,stable] releases are not considered.
        // Use alpha as stability with metaver 1, 0.2-alpha2 is simple ignored.
        // If anyone really uses this... not our problem :)
        if (0 === $this->major) {
            $candidates[] = $this->getNextIncreaseOf('patch');
            $candidates[] = $this->getNextIncreaseOf('minor');
            $candidates[] = self::fromString('1.0.0-BETA1');

            // stable (RC usually follows *after* beta, but jumps to stable are accepted)
            // RC is technically valid, but not very common and therefor ignored.
            $candidates[] = self::fromString('1.0.0');

            return $candidates;
        }

        // Latest is unstable, may increase stability or metaver (nothing else)
        // 1.0.1-beta1 is not accepted, an (un)stability only applies for x.0.0
        if ($this->stability < self::STABILITY_STABLE) {
            $candidates[] = new self($this->major, $this->minor, 0, $this->stability, $this->metaver + 1);

            for ($s = $this->stability + 1; $s < 3; ++$s) {
                $candidates[] = new self($this->major, $this->minor, 0, $s, 1);
            }

            $candidates[] = new self($this->major, $this->minor, 0, self::STABILITY_STABLE);

            return $candidates;
        }

        // Stable, so a patch, major or new minor (with lower stability) version is possible, RC is excluded.
        $candidates[] = $this->getNextIncreaseOf('patch');
        $candidates[] = $this->getNextIncreaseOf('beta');
        $candidates[] = $this->getNextIncreaseOf('minor');

        // New (un)stable major (excluding RC)
        $candidates[] = new self($this->major + 1, 0, 0, self::STABILITY_ALPHA, 1);
        $candidates[] = new self($this->major + 1, 0, 0, self::STABILITY_BETA, 1);
        $candidates[] = new self($this->major + 1, 0, 0, self::STABILITY_STABLE);

        return $candidates;
    }
public function getNextVersionCandidates ( ) : array { $ candidates = [ ] ; // Pre first-stable, so 0.x-[rc,beta,stable] releases are not considered. // Use alpha as stability with metaver 1, 0.2-alpha2 is simple ignored. // If anyone really uses this... not our problem :) if ( 0 === $ this -> major ) { $ candidates [ ] = $ this -> getNextIncreaseOf ( 'patch' ) ; $ candidates [ ] = $ this -> getNextIncreaseOf ( 'minor' ) ; $ candidates [ ] = self :: fromString ( '1.0.0-BETA1' ) ; // stable (RC usually follows *after* beta, but jumps to stable are accepted) // RC is technically valid, but not very common and therefor ignored. $ candidates [ ] = self :: fromString ( '1.0.0' ) ; return $ candidates ; } // Latest is unstable, may increase stability or metaver (nothing else) // 1.0.1-beta1 is not accepted, an (un)stability only applies for x.0.0 if ( $ this -> stability < self :: STABILITY_STABLE ) { $ candidates [ ] = new self ( $ this -> major , $ this -> minor , 0 , $ this -> stability , $ this -> metaver + 1 ) ; for ( $ s = $ this -> stability + 1 ; $ s < 3 ; ++ $ s ) { $ candidates [ ] = new self ( $ this -> major , $ this -> minor , 0 , $ s , 1 ) ; } $ candidates [ ] = new self ( $ this -> major , $ this -> minor , 0 , self :: STABILITY_STABLE ) ; return $ candidates ; } // Stable, so a patch, major or new minor (with lower stability) version is possible, RC is excluded. $ candidates [ ] = $ this -> getNextIncreaseOf ( 'patch' ) ; $ candidates [ ] = $ this -> getNextIncreaseOf ( 'beta' ) ; $ candidates [ ] = $ this -> getNextIncreaseOf ( 'minor' ) ; // New (un)stable major (excluding RC) $ candidates [ ] = new self ( $ this -> major + 1 , 0 , 0 , self :: STABILITY_ALPHA , 1 ) ; $ candidates [ ] = new self ( $ this -> major + 1 , 0 , 0 , self :: STABILITY_BETA , 1 ) ; $ candidates [ ] = new self ( $ this -> major + 1 , 0 , 0 , self :: STABILITY_STABLE ) ; return $ candidates ; }
Returns a list of possible feature versions.

* 0.1.0 -> [0.1.1, 0.2.0, 1.0.0-beta1, 1.0.0]
* 1.0.0 -> [1.0.1, 1.1.0, 2.0.0-beta1, 2.0.0]
* 1.0.1 -> [1.0.2, 1.2.0, 2.0.0-beta1, 2.0.0]
* 1.1.0 -> [1.2.0, 1.2.0-beta1, 2.0.0-beta1, 2.0.0]
* 1.0.0-beta1 -> [1.0.0-beta2, 1.0.0] (no minor or major increases)
* 1.0.0-alpha1 -> [1.0.0-alpha2, 1.0.0-beta1, 1.0.0] (no minor or major increases)

@return Version[]
Returns a list of possible feature versions .