mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-31 05:32:38 +02:00
Added siren and siret formatters (fr_FR)
This commit is contained in:
parent
6c399d3161
commit
055f4e9e8b
@ -12,4 +12,22 @@ class Company extends \Faker\Provider\Company
|
||||
);
|
||||
|
||||
protected static $companySuffix = array('SA', 'S.A.', 'SARL', 'S.A.R.L.', 'S.A.S.');
|
||||
|
||||
protected static $sirenFormat = "### ### ###";
|
||||
|
||||
public static function siret($maxSequentialDigits = 2)
|
||||
{
|
||||
if ($maxSequentialDigits > 4 || $maxSequentialDigits <= 0) {
|
||||
$maxSequentialDigits = 2;
|
||||
}
|
||||
|
||||
$sequentialNumber = str_pad(static::randomNumber($maxSequentialDigits), 4, '0', STR_PAD_LEFT);
|
||||
|
||||
return static::numerify(static::siren() . ' ' . $sequentialNumber . '#');
|
||||
}
|
||||
|
||||
public static function siren()
|
||||
{
|
||||
return static::numerify(static::$sirenFormat);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user