1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-03-23 00:39:47 +01:00

Added french catch phrase

This commit is contained in:
Geoffrey Brier 2012-07-01 10:00:15 +02:00
parent d1d44a5c19
commit 2fa2cf821e

View File

@ -4,6 +4,9 @@ namespace Faker\Provider\fr_FR;
class Company extends \Faker\Provider\Company
{
/**
* @var array French company name formats.
*/
protected static $formats = array(
'{{lastName}} {{companySuffix}}',
'{{lastName}} {{lastName}} {{companySuffix}}',
@ -11,10 +14,90 @@ class Company extends \Faker\Provider\Company
'{{lastName}}',
);
/**
* @var array French catch phrase formats.
*/
protected static $catchPhraseFormats = array(
'{{cpNoun}} {{cpVerb}} {{cpAttribute}}',
'{{cpNoun}} et {{cpNoun}} {{cpAttribute}}',
'{{cpNoun}} et {{cpNoun}} {{cpMultipleAttribute}}',
);
/**
* @var array French nouns (used by the catch phrase format).
*/
protected static $noun = array(
'la sécurité', 'le plaisir', "l'efficacité", 'le confort', 'la simplicité', 'la qualité', "l'assurance",
'la santé', 'la technologie', "l'art", 'le pouvoir', 'le prestige', "l'honneur", 'la chance', 'la faculté',
'la possibilité', 'le droit', "l'avantage", 'la liberté'
);
/**
* @var array French verbs (used by the catch phrase format).
*/
protected static $verb = array(
'de rouler', "d'avancer", "d'évoluer", 'de changer', "d'innover", 'de louer', "d'atteindre vos buts",
'de concrétiser vos projets'
);
/**
* @var array End of sentences (used by the catch phrase format).
*/
protected static $attribute = array(
'moins', 'de manière efficace', 'plus rapidement', 'plus facilement', 'plus simplement', 'en toute tranquilité',
'avant-tout', "d'abord", 'autrement', 'naturellement', 'à la pointe', 'sans soucis', "à l'état pur",
'à sa source', 'sûre', 'pour la vie'
);
/**
* @var array End of sentences when using multiple nouns (used by the catch phrase format).
*/
protected static $multipleAttribute = array('sont nos priorités', 'sont nos points forts', 'font notre force',
'qui assurent', 'sont nos passions', 'supérieurs'
);
/**
* @var array Company suffixes.
*/
protected static $companySuffix = array('SA', 'S.A.', 'SARL', 'S.A.R.L.', 'S.A.S.', 'et Fils');
/**
* @var string Siren format.
*/
protected static $sirenFormat = "### ### ###";
public function cpNoun()
{
return static::randomElement(static::$noun);
}
public function cpAttribute()
{
return static::randomElement(static::$attribute);
}
public function cpMultipleAttribute()
{
return static::randomElement(static::$multipleAttribute);
}
public function cpVerb()
{
return static::randomElement(static::$verb);
}
/**
* Generates a french catch phrase.
*
* @return string
*/
public function catchPhrase()
{
$format = static::randomElement(static::$catchPhraseFormats);
return ucfirst($this->generator->parse($format));
}
/**
* Generates a siret number (14 digits).
* It is in fact the result of the concatenation of a siren number (9 digits),