Skip to content

Commit c49e2de

Browse files
committed
Added docs.
1 parent 4cf7bde commit c49e2de

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ PHP utility used to parse application version strings, and retrieve information
66

77
The parser expects versions to be in the following format:
88

9-
`MajorVersion.MinorVersion.PatchVersion-BranchName-ReleaseTagNumber`
9+
`MajorVersion.MinorVersion.PatchVersion-BranchOrTag`
1010

1111
This allows the use of a wide range of version strings. Some examples:
1212

@@ -101,11 +101,14 @@ $number = $version->getVersion(); // 1
101101
```php
102102
use Mistralys\VersionParser\VersionParser;
103103

104-
$version = VersionParser::create('1-BETA');
104+
$version = VersionParser::create("1.2.0 'Cool Release' RC5");
105105

106-
$normalized = $version->getTagVersion(); // 1.0.0-beta
106+
$normalized = $version->getTagVersion(); // 1.0.0-CoolRelease-rc5
107107
```
108108

109+
> NOTE: The branch name is also normalized. Words are capitalized,
110+
> and spaces are removed. Other special characters are preserved.
111+
109112
### Checking the tag type
110113

111114
To check the release type, the shorthand methods `isBeta()`, `isAlpha()`,

0 commit comments

Comments
 (0)