Skip to content

Commit feb86a0

Browse files
Add docs for semver function (#47)
* Add docs for semver function * Add docs for semver function
1 parent b71f04d commit feb86a0

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

docs/formatters/version.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Version
2+
3+
## `semver`
4+
5+
Generate a random [semantic version v2.0.0](https://semver.org/spec/v2.0.0.html) string.
6+
7+
Optionally, the parameters `$preRelease` and `$build` can be set to `true` to randomly include pre-release and/or build
8+
parts into the version.
9+
10+
Examples:
11+
12+
```php
13+
echo $faker->semver();
14+
15+
// 0.0.1, 1.0.0, 9.99.99
16+
17+
echo $faker->semver(true, true);
18+
19+
// 0.0.1-beta, 1.0.0-rc.1, 1.5.9+276e88b, 5.6.2-alpha.2+20180419085616
20+
```

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ nav:
118118
- formatters/miscellaneous.md
119119
- formatters/biased.md
120120
- formatters/html-lorem.md
121+
- formatters/version.md
121122
- 'Locales': *locales
122123
- orm.md
123124
- third-party.md

0 commit comments

Comments
 (0)