1
0
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:
Francois Zaninotto 2012-04-14 21:26:19 +02:00
parent 606ee1a981
commit a2fc510821
2 changed files with 61 additions and 0 deletions

View 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);
}
}

View 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.');
}