Address.php
5 years ago
Company.php
5 years ago
Internet.php
5 years ago
Payment.php
5 years ago
Person.php
5 years ago
PhoneNumber.php
5 years ago
Text.php
5 years ago
Person.php
130 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Faker\Provider\fr_FR; |
| 4 | |
| 5 | class Person extends \Faker\Provider\Person |
| 6 | { |
| 7 | protected static $maleNameFormats = array( |
| 8 | '{{firstNameMale}} {{lastName}}', |
| 9 | '{{firstNameMale}} {{lastName}}', |
| 10 | '{{firstNameMale}} {{lastName}}', |
| 11 | '{{firstNameMale}} {{lastName}}', |
| 12 | '{{firstNameMale}} {{lastName}}', |
| 13 | '{{firstNameMale}} {{prefix}} {{lastName}}', |
| 14 | '{{firstNameMale}} {{lastName}}-{{lastName}}', |
| 15 | '{{firstNameMale}}-{{firstNameMale}} {{lastName}}', |
| 16 | ); |
| 17 | |
| 18 | protected static $femaleNameFormats = array( |
| 19 | '{{firstNameFemale}} {{lastName}}', |
| 20 | '{{firstNameFemale}} {{lastName}}', |
| 21 | '{{firstNameFemale}} {{lastName}}', |
| 22 | '{{firstNameFemale}} {{lastName}}', |
| 23 | '{{firstNameFemale}} {{lastName}}', |
| 24 | '{{firstNameFemale}} {{prefix}} {{lastName}}', |
| 25 | '{{firstNameFemale}} {{lastName}}-{{lastName}}', |
| 26 | '{{firstNameFemale}}-{{firstNameFemale}} {{lastName}}', |
| 27 | ); |
| 28 | |
| 29 | protected static $firstNameMale = array( |
| 30 | 'Adrien', 'Aimé', 'Alain', 'Alexandre', 'Alfred', 'Alphonse', 'André', 'Antoine', 'Arthur', 'Auguste', 'Augustin', |
| 31 | 'Benjamin', 'Benoît', 'Bernard', 'Bertrand', 'Charles', 'Christophe', 'Daniel', 'David', 'Denis', 'Édouard', 'Émile', |
| 32 | 'Emmanuel', 'Éric', 'Étienne', 'Eugène', 'François', 'Franck', 'Frédéric', 'Gabriel', 'Georges', 'Gérard', 'Gilbert', |
| 33 | 'Gilles', 'Grégoire', 'Guillaume', 'Guy', 'William', 'Henri', 'Honoré', 'Hugues', 'Isaac', 'Jacques', 'Jean', 'Jérôme', |
| 34 | 'Joseph', 'Jules', 'Julien', 'Laurent', 'Léon', 'Louis', 'Luc', 'Lucas', 'Marc', 'Marcel', 'Martin', 'Matthieu', |
| 35 | 'Maurice', 'Michel', 'Nicolas', 'Noël', 'Olivier', 'Patrick', 'Paul', 'Philippe', 'Pierre', 'Raymond', 'Rémy', 'René', |
| 36 | 'Richard', 'Robert', 'Roger', 'Roland', 'Sébastien', 'Stéphane', 'Théodore', 'Théophile', 'Thibaut', 'Thibault', 'Thierry', |
| 37 | 'Thomas', 'Timothée', 'Tristan', 'Victor', 'Vincent', 'Xavier', 'Yves', 'Zacharie', 'Claude', 'Dominique' |
| 38 | ); |
| 39 | |
| 40 | protected static $firstNameFemale = array( |
| 41 | 'Adélaïde', 'Adèle', 'Adrienne', 'Agathe', 'Agnès', 'Aimée', 'Alexandrie', 'Alix', 'Alexandria', 'Alex', 'Alice', |
| 42 | 'Amélie', 'Anaïs', 'Anastasie', 'Andrée', 'Anne', 'Anouk', 'Antoinette', 'Arnaude', 'Astrid', 'Audrey', 'Aurélie', |
| 43 | 'Aurore', 'Bernadette', 'Brigitte', 'Capucine', 'Caroline', 'Catherine', 'Cécile', 'Céline', 'Célina', 'Chantal', |
| 44 | 'Charlotte', 'Christelle', 'Christiane', 'Christine', 'Claire', 'Claudine', 'Clémence', 'Colette', 'Constance', |
| 45 | 'Corinne', 'Danielle', 'Denise', 'Diane', 'Dorothée', 'Édith', 'Éléonore', 'Élisabeth', 'Élise', 'Élodie', 'Émilie', |
| 46 | 'Emmanuelle', 'Françoise', 'Frédérique', 'Gabrielle', 'Geneviève', 'Hélène', 'Henriette', 'Hortense', 'Inès', 'Isabelle', |
| 47 | 'Jacqueline', 'Jeanne', 'Jeannine', 'Joséphine', 'Josette', 'Julie', 'Juliette', 'Laetitia', 'Laure', 'Laurence', |
| 48 | 'Lorraine', 'Louise', 'Luce', 'Lucie', 'Lucy', 'Madeleine', 'Manon', 'Marcelle', 'Margaux', 'Margaud', 'Margot', |
| 49 | 'Marguerite', 'Margot', 'Margaret', 'Maggie', 'Marianne', 'Marie', 'Marine', 'Marthe', 'Martine', 'Maryse', |
| 50 | 'Mathilde', 'Michèle', 'Michelle', 'Michelle', 'Monique', 'Nathalie', 'Nath', 'Nathalie', 'Nicole', 'Noémi', 'Océane', |
| 51 | 'Odette', 'Olivie', 'Patricia', 'Paulette', 'Pauline', 'Pénélope', 'Philippine', 'Renée', 'Sabine', 'Simone', 'Sophie', |
| 52 | 'Stéphanie', 'Susanne', 'Suzanne', 'Susan', 'Suzanne', 'Sylvie', 'Thérèse', 'Valentine', 'Valérie', 'Véronique', |
| 53 | 'Victoire', 'Virginie', 'Zoé', 'Camille', 'Dominique' |
| 54 | ); |
| 55 | |
| 56 | protected static $lastName = array( |
| 57 | 'Martin', 'Bernard', 'Thomas', 'Robert', 'Petit', 'Dubois', 'Richard', 'Garcia', 'Durand', 'Moreau', 'Lefebvre', 'Simon', 'Laurent', 'Michel', 'Leroy', 'Martinez', 'David', 'Fontaine', 'Da Silva', 'Morel', 'Fournier', 'Dupont', 'Bertrand', 'Lambert', 'Rousseau', 'Girard', 'Roux', 'Vincent', 'Lefevre', 'Boyer', 'Lopez', 'Bonnet', 'Andre', 'Francois', 'Mercier', 'Muller', 'Guerin', 'Legrand', 'Sanchez', 'Garnier', 'Chevalier', 'Faure', 'Perez', 'Clement', 'Fernandez', 'Blanc', 'Robin', 'Morin', 'Gauthier', 'Pereira', 'Perrin', 'Roussel', 'Henry', 'Duval', 'Gautier', 'Nicolas', 'Masson', 'Marie', 'Noel', 'Ferreira', 'Lemaire', 'Mathieu', 'Riviere', 'Denis', 'Marchand', 'Rodriguez', 'Dumont', 'Payet', 'Lucas', 'Dufour', 'Dos Santos', 'Joly', 'Blanchard', 'Meunier', 'Rodrigues', 'Caron', 'Gerard', 'Fernandes', 'Brunet', 'Meyer', 'Barbier', 'Leroux', 'Renard', 'Goncalves', 'Gaillard', 'Brun', 'Roy', 'Picard', 'Giraud', 'Roger', 'Schmitt', 'Colin', 'Arnaud', 'Vidal', 'Gonzalez', 'Lemoine', 'Roche', 'Aubert', 'Olivier', 'Leclercq', 'Pierre', 'Philippe', 'Bourgeois', 'Renaud', 'Martins', 'Leclerc', 'Guillaume', 'Lacroix', 'Lecomte', 'Benoit', 'Fabre', 'Carpentier', 'Vasseur', 'Louis', 'Hubert', 'Jean', 'Dumas', 'Rolland', 'Grondin', 'Rey', 'Huet', 'Gomez', 'Dupuis', 'Guillot', 'Berger', 'Moulin', 'Hoarau', 'Menard', 'Deschamps', 'Fleury', 'Adam', 'Boucher', 'Poirier', 'Bertin', 'Charles', 'Aubry', 'Da Costa', 'Royer', 'Dupuy', 'Maillard', 'Paris', 'Baron', 'Lopes', 'Guyot', 'Carre', 'Jacquet', 'Renault', 'Herve', 'Charpentier', 'Klein', 'Cousin', 'Collet', 'Leger', 'Ribeiro', 'Hernandez', 'Bailly', 'Schneider', 'Le Gall', 'Ruiz', 'Langlois', 'Bouvier', 'Gomes', 'Prevost', 'Julien', 'Lebrun', 'Breton', 'Germain', 'Millet', 'Boulanger', 'Remy', 'Le Roux', 'Daniel', 'Marques', 'Maillot', 'Leblanc', 'Le Goff', 'Barre', 'Perrot', 'Leveque', 'Marty', 'Benard', 'Monnier', 'Hamon', 'Pelletier', 'Alves', 'Etienne', 'Marchal', 'Poulain', 'Tessier', 'Lemaitre', 'Guichard', 'Besson', 'Mallet', 'Hoareau', 'Gillet', 'Weber', 'Jacob', 'Collin', 'Chevallier', 'Perrier', 'Michaud', 'Carlier', 'Delaunay', 'Chauvin', 'Alexandre', 'Marechal', 'Antoine', 'Lebon', 'Cordier', 'Lejeune', 'Bouchet', 'Pasquier', 'Legros', 'Delattre', 'Humbert', 'De Oliveira', 'Briand', 'Lamy', 'Launay', 'Gilbert', 'Perret', 'Lesage', 'Gay', 'Nguyen', 'Navarro', 'Besnard', 'Pichon', 'Hebert', 'Cohen', 'Pons', 'Lebreton', 'Sauvage', 'De Sousa', 'Pineau', 'Albert', 'Jacques', 'Pinto', 'Barthelemy', 'Turpin', 'Bigot', 'Lelievre', 'Georges', 'Reynaud', 'Ollivier', 'Martel', 'Voisin', 'Leduc', 'Guillet', 'Vallee', 'Coulon', 'Camus', 'Marin', 'Teixeira', 'Costa', 'Mahe', 'Didier', 'Charrier', 'Gaudin', 'Bodin', 'Guillou', 'Gregoire', 'Gros', 'Blanchet', 'Buisson', 'Blondel', 'Paul', 'Dijoux', 'Barbe', 'Hardy', 'Laine', 'Evrard', 'Laporte', 'Rossi', 'Joubert', 'Regnier', 'Tanguy', 'Gimenez', 'Allard', 'Devaux', 'Morvan', 'Levy', 'Dias', 'Courtois', 'Lenoir', 'Berthelot', 'Pascal', 'Vaillant', 'Guilbert', 'Thibault', 'Moreno', 'Duhamel', 'Colas', 'Masse', 'Baudry', 'Bruneau', 'Verdier', 'Delorme', 'Blin', 'Guillon', 'Mary', 'Coste', 'Pruvost', 'Maury', 'Allain', 'Valentin', 'Godard', 'Joseph', 'Brunel', 'Marion', 'Texier', 'Seguin', 'Raynaud', 'Bourdon', 'Raymond', 'Bonneau', 'Chauvet', 'Maurice', 'Legendre', 'Loiseau', 'Ferrand', 'Toussaint', 'Techer', 'Lombard', 'Lefort', 'Couturier', 'Bousquet', 'Diaz', 'Riou', 'Clerc', 'Weiss', 'Imbert', 'Jourdan', 'Delahaye', 'Gilles', 'Guibert', 'Begue', 'Descamps', 'Delmas', 'Peltier', 'Dupre', 'Chartier', 'Martineau', 'Laroche', 'Leconte', 'Maillet', 'Parent', 'Labbe', 'Potier', 'Bazin', 'Normand', 'Pottier', 'Torres', 'Lagarde', 'Blot', 'Jacquot', 'Lemonnier', 'Grenier', 'Rocher', 'Bonnin', 'Boutin', 'Fischer', 'Munoz', 'Neveu', 'Lacombe', 'Mendes', 'Delannoy', 'Auger', 'Wagner', 'Fouquet', 'Mace', 'Ramos', 'Pages', 'Petitjean', 'Chauveau', 'Foucher', 'Peron', 'Guyon', 'Gallet', 'Rousset', 'Traore', 'Bernier', 'Vallet', 'Letellier', 'Bouvet', 'Hamel', 'Chretien', 'Faivre', 'Boulay', 'Thierry', 'Samson', 'Ledoux', 'Salmon', 'Gosselin', 'Lecoq', 'Pires', 'Leleu', 'Becker', 'Diallo', 'Merle', 'Valette' |
| 58 | ); |
| 59 | |
| 60 | protected static $titleMale = array('M.', 'Dr.', 'Pr.', 'Me.'); |
| 61 | |
| 62 | protected static $titleFemale = array('Mme.', 'Mlle', 'Dr.', 'Pr.', 'Me.'); |
| 63 | |
| 64 | protected static $prefix = array('de', 'de la', 'Le', 'du'); |
| 65 | |
| 66 | public static function prefix() |
| 67 | { |
| 68 | return static::randomElement(static::$prefix); |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Generates a NIR / Sécurité Sociale number (13 digits + 2 digits for the key) |
| 73 | * |
| 74 | * @see https://fr.wikipedia.org/wiki/Num%C3%A9ro_de_s%C3%A9curit%C3%A9_sociale_en_France |
| 75 | * @return string |
| 76 | */ |
| 77 | public function nir($gender = null, $formatted = false) |
| 78 | { |
| 79 | // Gender |
| 80 | if ($gender === static::GENDER_MALE) { |
| 81 | $nir = 1; |
| 82 | } elseif ($gender === static::GENDER_FEMALE) { |
| 83 | $nir = 2; |
| 84 | } else { |
| 85 | $nir = $this->numberBetween(1, 2); |
| 86 | } |
| 87 | |
| 88 | $nir .= |
| 89 | // Year of birth (aa) |
| 90 | $this->numerify('##') . |
| 91 | // Mont of birth (mm) |
| 92 | sprintf('%02d', $this->numberBetween(1, 12)); |
| 93 | |
| 94 | // Department |
| 95 | $department = key(Address::department()); |
| 96 | $nir .= $department; |
| 97 | |
| 98 | // Town number, depends on department length |
| 99 | if (strlen($department) === 2) { |
| 100 | $nir .= $this->numerify('###'); |
| 101 | } elseif (strlen($department) === 3) { |
| 102 | $nir .= $this->numerify('##'); |
| 103 | } |
| 104 | |
| 105 | // Born number (depending of town and month of birth) |
| 106 | $nir .= $this->numerify('###'); |
| 107 | |
| 108 | /** |
| 109 | * The key for a given NIR is `97 - 97 % NIR` |
| 110 | * NIR has to be an integer, so we have to do a little replacment |
| 111 | * for departments 2A and 2B |
| 112 | */ |
| 113 | if ($department === '2A') { |
| 114 | $nirInteger = str_replace('2A', '19', $nir); |
| 115 | } elseif ($department === '2B') { |
| 116 | $nirInteger = str_replace('2B', '18', $nir); |
| 117 | } else { |
| 118 | $nirInteger = $nir; |
| 119 | } |
| 120 | $nir .= sprintf('%02d', 97 - $nirInteger % 97); |
| 121 | |
| 122 | // Format is x xx xx xx xxx xxx xx |
| 123 | if ($formatted) { |
| 124 | $nir = substr($nir, 0, 1) . ' ' . substr($nir, 1, 2) . ' ' . substr($nir, 3, 2) . ' ' . substr($nir, 5, 2) . ' ' . substr($nir, 7, 3). ' ' . substr($nir, 10, 3). ' ' . substr($nir, 13, 2); |
| 125 | } |
| 126 | |
| 127 | return $nir; |
| 128 | } |
| 129 | } |
| 130 |