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 2
2
3
3
namespace Version ;
4
4
5
- use JsonSchema \Exception \InvalidArgumentException ;
6
-
7
5
class Stability
8
6
{
9
7
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*) ' ;
11
9
12
10
/**
13
11
* @var string
@@ -109,7 +107,7 @@ private function toInt( $stability )
109
107
case 'patch ' :
110
108
return 6 ;
111
109
default :
112
- throw new InvalidArgumentException ( 'Invalid stability: ' . $ stability );
110
+ throw new \ InvalidArgumentException ( 'Invalid stability: ' . $ stability );
113
111
}
114
112
}
115
113
}
Original file line number Diff line number Diff line change @@ -208,8 +208,8 @@ public function __toString()
208
208
$ version =
209
209
$ this ->major . '. ' .
210
210
$ this ->minor . '. ' .
211
- $ this ->revision . ' . ' .
212
- (int )$ this ->micro ;
211
+ $ this ->revision ;
212
+ if ( $ this -> micro !== null ) $ version .= ' . ' . (int )$ this ->micro ;
213
213
} else {
214
214
$ version = $ this ->major ;
215
215
if ($ this ->minor ) $ version .= '- ' . $ this ->minor ;
You can’t perform that action at this time.
0 commit comments