File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 22
33namespace Version ;
44
5- use JsonSchema \Exception \InvalidArgumentException ;
6-
75class Stability
86{
97
10- const REGEX = '[-|_|\.]{0,1}([R|r][C|c]|pl|a|alpha|[B|b][E|e][T|t][A|a]|b|B|patch|stable|p)\.{0,1}(\d*) ' ;
8+ const REGEX = '[-|_|\.]{0,1}([R|r][C|c]|pl|a|alpha|[B|b][E|e][T|t][A|a]|b|B|patch|stable|p|[D|d][E|e][V|v]|[D|d] )\.{0,1}(\d*) ' ;
119
1210 /**
1311 * @var string
@@ -109,7 +107,7 @@ private function toInt( $stability )
109107 case 'patch ' :
110108 return 6 ;
111109 default :
112- throw new InvalidArgumentException ( 'Invalid stability: ' . $ stability );
110+ throw new \ InvalidArgumentException ( 'Invalid stability: ' . $ stability );
113111 }
114112 }
115113}
Original file line number Diff line number Diff line change @@ -208,8 +208,8 @@ public function __toString()
208208 $ version =
209209 $ this ->major . '. ' .
210210 $ this ->minor . '. ' .
211- $ this ->revision . ' . ' .
212- (int )$ this ->micro ;
211+ $ this ->revision ;
212+ if ( $ this -> micro !== null ) $ version .= ' . ' . (int )$ this ->micro ;
213213 } else {
214214 $ version = $ this ->major ;
215215 if ($ this ->minor ) $ version .= '- ' . $ this ->minor ;
You can’t perform that action at this time.
0 commit comments