Skip to content

Commit 88f084a

Browse files
committed
Added Version::parse() info to the README
1 parent f8006fd commit 88f084a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,17 @@ $version = new SemVer\Version(); // Initilializes to '0.1.0'
5555
```
5656

5757
Or initialize with a custom version by passing a version string on creation.
58-
Accepts any valid semantic version string with or without a preceding 'v'.
58+
Accepts any valid semantic version string with or without a preceding `v`.
5959

6060
```php
61-
$version = new SemVer\Version('v1.2.3-alpha.5-sha.8d31ff4');
61+
$version = new SemVer\Version('v1.2.3-alpha.5+sha.8d31ff4');
62+
```
63+
64+
Or parse an incomple version string with the static `Version::parse()` constructor.
65+
66+
```php
67+
$version = SemVer\Version::parse('v1') // Initializes to '1.0.0'
68+
$version = SemVer\Version::parse('v1.2') // Initializes to '1.2.0'
6269
```
6370

6471
Usage

0 commit comments

Comments
 (0)