original_string: public function format()
      {
          $ret = '';
  
          foreach (self::$formats as $key => $format) {
              $value = $this->get($key);
  
              // -stable is not added to the version, it is implied
              if ($key == self::STABILITY && $value == end(self::$stabilities)) {
                  break;
              }
  
              $ret .= sprintf($format, $value);
  
              // -dev has no stability increments
              if ($key == self::STABILITY && $value == self::$stabilities[0]) {
                  break;
              }
          }
  
          return $ret;
      }
code: public function format()
      {
          $ret = '';
  
          foreach (self::$formats as $key => $format) {
              $value = $this->get($key);
  
              // -stable is not added to the version, it is implied
              if ($key == self::STABILITY && $value == end(self::$stabilities)) {
                  break;
              }
  
              $ret .= sprintf($format, $value);
  
              // -dev has no stability increments
              if ($key == self::STABILITY && $value == self::$stabilities[0]) {
                  break;
              }
          }
  
          return $ret;
      }
code_tokens: public function format ( ) { $ ret = '' ; foreach ( self :: $ formats as $ key => $ format ) { $ value = $ this -> get ( $ key ) ; // -stable is not added to the version, it is implied if ( $ key == self :: STABILITY && $ value == end ( self :: $ stabilities ) ) { break ; } $ ret .= sprintf ( $ format , $ value ) ; // -dev has no stability increments if ( $ key == self :: STABILITY && $ value == self :: $ stabilities [ 0 ] ) { break ; } } return $ ret ; }
docstring: Formats the version.
  
  @return string
docstring_tokens: Formats the version .