Skip to content

Commit 7523d8f

Browse files
author
Bram Ceulemans
committed
Added documentation for Biased and HtmlLorem provider
1 parent 433ab31 commit 7523d8f

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

docs/formatters/biased.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Biased
2+
3+
## `biasedNumberBetween`
4+
5+
Generate a random `integer`, with a bias using a given function.
6+
7+
```php
8+
function biasedNumberBetween(int $min = 0, int $max = 100, string $function = 'sqrt'): int;
9+
```
10+
11+
Examples:
12+
13+
```php
14+
echo $faker->biasedNumberBetween(0, 20);
15+
16+
// 14, 18, 12
17+
18+
echo $faker->biasedNumberBetween(0, 20, 'log');
19+
20+
// 9, 4, 12
21+
```

docs/formatters/html-lorem.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# HTML Lorem
2+
3+
## `htmlLorem`
4+
5+
Generate a random HTML `string`, with a given maximum depth and width. By default, the depth and width are `4`.
6+
7+
Depth defines the maximum depth of the body.
8+
9+
Width defines the maximum of siblings each element can have.
10+
11+
```php
12+
echo $faker->randomHtml();
13+
14+
// '<html><head><title>Laborum doloribus voluptatum vitae quia voluptatum ipsum veritatis.</title></head><body><form action="example.org" method="POST"><label for="username">sit</label><input type="text" id="username"><label for="password">amet</label><input type="password" id="password"></form><div class="et"><span>Numquam magnam.</span><p>Neque facere consequuntur autem quisquam.</p><ul><li>Veritatis sint.</li><li>Et ducimus.</li><li>Veniam accusamus cupiditate.</li><li>Eligendi eum et doloribus.</li><li>Voluptate ipsa dolores est.</li><li>Enim.</li><li>Dignissimos nostrum atque et excepturi.</li><li>Nisi veniam.</li><li>Voluptate nihil labore sapiente.</li><li>Ut.</li><li>Id suscipit.</li></ul><i>Qui tempora minima ad.</i></div></body></html>'
15+
16+
echo $faker->randomHtml(1, 1);
17+
18+
// '<html><head><title>Architecto ut eius nisi molestiae atque ab.</title></head><body><form action="example.net" method="POST"><label for="username">saepe</label><input type="text" id="username"><label for="password">est</label><input type="password" id="password"></form></body></html>'
19+
```

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ nav:
9797
- formatters/uuid.md
9898
- formatters/barcode.md
9999
- formatters/miscellaneous.md
100+
- formatters/biased.md
101+
- formatters/html-lorem.md
100102
- 'Locales': *locales
101103
- third-party.md
102104

0 commit comments

Comments
 (0)