diff --git a/src/Faker/Provider/fr_FR/Company.php b/src/Faker/Provider/fr_FR/Company.php index 7e3cf92f..fe7d326f 100644 --- a/src/Faker/Provider/fr_FR/Company.php +++ b/src/Faker/Provider/fr_FR/Company.php @@ -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); + } } \ No newline at end of file