mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-19 06:49:50 +01:00
add phpdoc comments and updated readme.md
This commit is contained in:
parent
86e8ad2c08
commit
dd9ba3eb54
@ -226,6 +226,11 @@ Each of the generator properties (like `name`, `address`, and `lorem`) are calle
|
||||
imageUrl($width, $height) // 'http://lorempixel.com/800/600/'
|
||||
imageUrl($width, $height, $category) // 'http://lorempixel.com/800/600/person/'
|
||||
|
||||
### `Faker\Provider\Barcode`
|
||||
|
||||
ean13 // '4006381333931'
|
||||
ean8 // '73513537'
|
||||
|
||||
## Unique and Optional modifiers
|
||||
|
||||
Faker provides two special providers, `unique()` and `optional()`, to be called before any provider. `optional()` can be useful for seeding non-required fields, like a mobile telephone number ; `unique()` is required to populate fields that cannot accept twice the same value, like primary identifiers.
|
||||
|
@ -25,11 +25,21 @@ class Barcode extends \Faker\Provider\Base
|
||||
return implode('', $code) . $checksum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a random EAN13 barcode.
|
||||
* @return string
|
||||
* @example '4006381333931'
|
||||
*/
|
||||
public function ean13()
|
||||
{
|
||||
return $this->ean(13);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a random EAN8 barcode.
|
||||
* @return string
|
||||
* @example '73513537'
|
||||
*/
|
||||
public function ean8()
|
||||
{
|
||||
return $this->ean(8);
|
||||
|
Loading…
x
Reference in New Issue
Block a user