mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-19 23:09:47 +01:00
Add French Address and Company providers
This commit is contained in:
parent
606ee1a981
commit
a2fc510821
46
src/Faker/Provider/fr_FR/Address.php
Normal file
46
src/Faker/Provider/fr_FR/Address.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Faker\Provider\fr_FR;
|
||||
|
||||
class Address extends \Faker\Provider\Address
|
||||
{
|
||||
protected static $citySuffix = array('Ville', 'Bourg', '-les-Bains', '-sur-Mer', '-la-Forêt', 'boeuf', 'nec', 'dan');
|
||||
protected static $streetPrefix = array('rue', 'rue', 'chemin', 'avenue', 'boulevard');
|
||||
protected static $cityFormats = array(
|
||||
'{{lastName}}',
|
||||
'{{lastName}}',
|
||||
'{{lastName}}',
|
||||
'{{lastName}}',
|
||||
'{{lastName}}{{citySuffix}}',
|
||||
'{{lastName}}{{citySuffix}}',
|
||||
'{{lastName}}{{citySuffix}}',
|
||||
'{{lastName}}-sur-{{lastName}}',
|
||||
);
|
||||
protected static $streetNameFormats = array(
|
||||
'{{streetPrefix}} {{lastName}}',
|
||||
'{{streetPrefix}} {{firstName}} {{lastName}}',
|
||||
'{{streetPrefix}} de {{lastName}}',
|
||||
);
|
||||
protected static $streetAddressFormats = array(
|
||||
'{{streetName}}',
|
||||
'{{buildingNumber}}, {{streetName}}',
|
||||
'{{buildingNumber}}, {{streetName}}',
|
||||
'{{buildingNumber}}, {{streetName}}',
|
||||
'{{buildingNumber}}, {{streetName}}',
|
||||
'{{buildingNumber}}, {{streetName}}',
|
||||
);
|
||||
protected static $addressFormats = array(
|
||||
"{{streetAddress}}\n{{postcode}} {{city}}",
|
||||
);
|
||||
|
||||
protected static $buildingNumber = array('%', '%#', '%#', '%#', '%##');
|
||||
protected static $postcode = array('#####', '## ###');
|
||||
|
||||
/**
|
||||
* @example 'rue'
|
||||
*/
|
||||
public static function streetPrefix()
|
||||
{
|
||||
return static::randomElement(static::$streetPrefix);
|
||||
}
|
||||
}
|
15
src/Faker/Provider/fr_FR/Company.php
Normal file
15
src/Faker/Provider/fr_FR/Company.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Faker\Provider\fr_FR;
|
||||
|
||||
class Company extends \Faker\Provider\Company
|
||||
{
|
||||
protected static $formats = array(
|
||||
'{{lastName}} {{companySuffix}}',
|
||||
'{{lastName}} {{lastName}} {{companySuffix}}',
|
||||
'{{lastName}}',
|
||||
'{{lastName}}',
|
||||
);
|
||||
|
||||
protected static $companySuffix = array('SA', 'S.A.', 'SARL', 'S.A.R.L.', 'S.A.S.');
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user