public function increment($part)
    {
        foreach (array_reverse(self::$ordinality) as $currentPart) {
            if ($currentPart === $part) {
                switch ($part) {
                    case self::STABILITY:
                        $this->set(
                            $currentPart, 
                            self::$stabilities[
                                array_search(
                                    $this->get($currentPart), 
                                    self::$stabilities
                                ) +1
                            ]
                        );
                        break;
                    default:
                        $this->set($currentPart, $this->get($currentPart) +1);
                        break;
                }
                break;
            } else {
                switch ($currentPart) {
                    case self::STABILITY_NO:
                        $this->set($currentPart, null);
                        break;
                    case self::STABILITY:
                        $this->set($currentPart, 'dev');
                        break;
                    default:
                        $this->set($currentPart, '0');
                }
            }
        }

        return $this;
    }
public function increment($part)
    {
        foreach (array_reverse(self::$ordinality) as $currentPart) {
            if ($currentPart === $part) {
                switch ($part) {
                    case self::STABILITY:
                        $this->set(
                            $currentPart, 
                            self::$stabilities[
                                array_search(
                                    $this->get($currentPart), 
                                    self::$stabilities
                                ) +1
                            ]
                        );
                        break;
                    default:
                        $this->set($currentPart, $this->get($currentPart) +1);
                        break;
                }
                break;
            } else {
                switch ($currentPart) {
                    case self::STABILITY_NO:
                        $this->set($currentPart, null);
                        break;
                    case self::STABILITY:
                        $this->set($currentPart, 'dev');
                        break;
                    default:
                        $this->set($currentPart, '0');
                }
            }
        }

        return $this;
    }
public function increment ( $ part ) { foreach ( array_reverse ( self :: $ ordinality ) as $ currentPart ) { if ( $ currentPart === $ part ) { switch ( $ part ) { case self :: STABILITY : $ this -> set ( $ currentPart , self :: $ stabilities [ array_search ( $ this -> get ( $ currentPart ) , self :: $ stabilities ) + 1 ] ) ; break ; default : $ this -> set ( $ currentPart , $ this -> get ( $ currentPart ) + 1 ) ; break ; } break ; } else { switch ( $ currentPart ) { case self :: STABILITY_NO : $ this -> set ( $ currentPart , null ) ; break ; case self :: STABILITY : $ this -> set ( $ currentPart , 'dev' ) ; break ; default : $ this -> set ( $ currentPart , '0' ) ; } } } return $ this ; }
Increment a specific part of the version.

E.g.:
incrementing "stability" of "2.0.0-alpha.4" would b

@param string $part
@return $this
Increment a specific part of the version .