| 148 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace Faker\Provider\en_GB;
|
|
|
4 |
|
|
|
5 |
class Person extends \Faker\Provider\Person
|
|
|
6 |
{
|
|
|
7 |
protected static $maleNameFormats = [
|
|
|
8 |
'{{firstNameMale}} {{lastName}}',
|
|
|
9 |
];
|
|
|
10 |
|
|
|
11 |
protected static $femaleNameFormats = [
|
|
|
12 |
'{{firstNameFemale}} {{lastName}}',
|
|
|
13 |
];
|
|
|
14 |
|
|
|
15 |
/**
|
|
|
16 |
* @see http://www.ons.gov.uk/ons/rel/vsob1/baby-names--england-and-wales/2013/index.html
|
|
|
17 |
*/
|
|
|
18 |
protected static $firstNameMale = [
|
|
|
19 |
'Aaron', 'Adam', 'Adrian', 'Aiden', 'Alan', 'Alex', 'Alexander', 'Alfie', 'Andrew', 'Andy', 'Anthony', 'Archie', 'Arthur',
|
|
|
20 |
'Barry', 'Ben', 'Benjamin', 'Bradley', 'Brandon', 'Bruce',
|
|
|
21 |
'Callum', 'Cameron', 'Charles', 'Charlie', 'Chris', 'Christian', 'Christopher', 'Colin', 'Connor', 'Craig',
|
|
|
22 |
'Dale', 'Damien', 'Dan', 'Daniel', 'Darren', 'Dave', 'David', 'Dean', 'Dennis', 'Dominic', 'Duncan', 'Dylan',
|
|
|
23 |
'Edward', 'Elliot', 'Elliott', 'Ethan',
|
|
|
24 |
'Finley', 'Frank', 'Fred', 'Freddie',
|
|
|
25 |
'Gary', 'Gavin', 'George', 'Gordon', 'Graham', 'Grant', 'Greg',
|
|
|
26 |
'Harley', 'Harrison', 'Harry', 'Harvey', 'Henry',
|
|
|
27 |
'Ian', 'Isaac',
|
|
|
28 |
'Jack', 'Jackson', 'Jacob', 'Jake', 'James', 'Jamie', 'Jason', 'Jayden', 'Jeremy', 'Jim', 'Joe', 'Joel', 'John', 'Jonathan', 'Jordan', 'Joseph', 'Joshua',
|
|
|
29 |
'Karl', 'Keith', 'Ken', 'Kevin', 'Kieran', 'Kyle',
|
|
|
30 |
'Lee', 'Leo', 'Lewis', 'Liam', 'Logan', 'Louis', 'Lucas', 'Luke',
|
|
|
31 |
'Mark', 'Martin', 'Mason', 'Matthew', 'Max', 'Michael', 'Mike', 'Mohammed', 'Muhammad',
|
|
|
32 |
'Nathan', 'Neil', 'Nick', 'Noah',
|
|
|
33 |
'Oliver', 'Oscar', 'Owen',
|
|
|
34 |
'Patrick', 'Paul', 'Pete', 'Peter', 'Philip',
|
|
|
35 |
'Quentin',
|
|
|
36 |
'Ray', 'Reece', 'Riley', 'Rob', 'Ross', 'Ryan',
|
|
|
37 |
'Samuel', 'Scott', 'Sean', 'Sebastian', 'Stefan', 'Stephen', 'Steve',
|
|
|
38 |
'Theo', 'Thomas', 'Tim', 'Toby', 'Tom', 'Tony', 'Tyler',
|
|
|
39 |
'Wayne', 'Will', 'William',
|
|
|
40 |
'Zachary', 'Zach',
|
|
|
41 |
];
|
|
|
42 |
|
|
|
43 |
protected static $firstNameFemale = [
|
|
|
44 |
'Abbie', 'Abigail', 'Adele', 'Alexa', 'Alexandra', 'Alice', 'Alison', 'Amanda', 'Amber', 'Amelia', 'Amy', 'Anna', 'Ashley', 'Ava',
|
|
|
45 |
'Beth', 'Bethany', 'Becky',
|
|
|
46 |
'Caitlin', 'Candice', 'Carlie', 'Carmen', 'Carole', 'Caroline', 'Carrie', 'Charlotte', 'Chelsea', 'Chloe', 'Claire', 'Courtney',
|
|
|
47 |
'Daisy', 'Danielle', 'Donna',
|
|
|
48 |
'Eden', 'Eileen', 'Eleanor', 'Elizabeth', 'Ella', 'Ellie', 'Elsie', 'Emily', 'Emma', 'Erin', 'Eva', 'Evelyn', 'Evie',
|
|
|
49 |
'Faye', 'Fiona', 'Florence', 'Francesca', 'Freya',
|
|
|
50 |
'Georgia', 'Grace',
|
|
|
51 |
'Hannah', 'Heather', 'Helen', 'Helena', 'Hollie', 'Holly',
|
|
|
52 |
'Imogen', 'Isabel', 'Isabella', 'Isabelle', 'Isla', 'Isobel',
|
|
|
53 |
'Jade', 'Jane', 'Jasmine', 'Jennifer', 'Jessica', 'Joanne', 'Jodie', 'Julia', 'Julie', 'Justine',
|
|
|
54 |
'Karen', 'Karlie', 'Katie', 'Keeley', 'Kelly', 'Kimberly', 'Kirsten', 'Kirsty',
|
|
|
55 |
'Laura', 'Lauren', 'Layla', 'Leah', 'Leanne', 'Lexi', 'Lilly', 'Lily', 'Linda', 'Lindsay', 'Lisa', 'Lizzie', 'Lola', 'Lucy',
|
|
|
56 |
'Maisie', 'Mandy', 'Maria', 'Mary', 'Matilda', 'Megan', 'Melissa', 'Mia', 'Millie', 'Molly',
|
|
|
57 |
'Naomi', 'Natalie', 'Natasha', 'Nicole', 'Nikki',
|
|
|
58 |
'Olivia',
|
|
|
59 |
'Patricia', 'Paula', 'Pauline', 'Phoebe', 'Poppy',
|
|
|
60 |
'Rachel', 'Rebecca', 'Rosie', 'Rowena', 'Roxanne', 'Ruby', 'Ruth',
|
|
|
61 |
'Sabrina', 'Sally', 'Samantha', 'Sarah', 'Sasha', 'Scarlett', 'Selina', 'Shannon', 'Sienna', 'Sofia', 'Sonia', 'Sophia', 'Sophie', 'Stacey', 'Stephanie', 'Suzanne', 'Summer',
|
|
|
62 |
'Tanya', 'Tara', 'Teagan', 'Theresa', 'Tiffany', 'Tina', 'Tracy',
|
|
|
63 |
'Vanessa', 'Vicky', 'Victoria',
|
|
|
64 |
'Wendy',
|
|
|
65 |
'Yasmine', 'Yvette', 'Yvonne',
|
|
|
66 |
'Zoe',
|
|
|
67 |
];
|
|
|
68 |
|
|
|
69 |
/**
|
|
|
70 |
* @see http://surname.sofeminine.co.uk/w/surnames/most-common-surnames-in-great-britain.html
|
|
|
71 |
*/
|
|
|
72 |
protected static $lastName = [
|
|
|
73 |
'Adams', 'Allen', 'Anderson',
|
|
|
74 |
'Bailey', 'Baker', 'Bell', 'Bennett', 'Brown', 'Butler',
|
|
|
75 |
'Campbell', 'Carter', 'Chapman', 'Clark', 'Clarke', 'Collins', 'Cook', 'Cooper', 'Cox',
|
|
|
76 |
'Davies', 'Davis',
|
|
|
77 |
'Edwards', 'Ellis', 'Evans',
|
|
|
78 |
'Fox',
|
|
|
79 |
'Graham', 'Gray', 'Green', 'Griffiths',
|
|
|
80 |
'Hall', 'Harris', 'Harrison', 'Hill', 'Holmes', 'Hughes', 'Hunt', 'Hunter',
|
|
|
81 |
'Jackson', 'James', 'Johnson', 'Jones',
|
|
|
82 |
'Kelly', 'Kennedy', 'Khan', 'King', 'Knight',
|
|
|
83 |
'Lee', 'Lewis', 'Lloyd',
|
|
|
84 |
'Marshall', 'Martin', 'Mason', 'Matthews', 'Miller', 'Mitchell', 'Moore', 'Morgan', 'Morris', 'Murphy', 'Murray',
|
|
|
85 |
'Owen',
|
|
|
86 |
'Palmer', 'Parker', 'Patel', 'Phillips', 'Powell', 'Price',
|
|
|
87 |
'Reid', 'Reynolds', 'Richards', 'Richardson', 'Roberts', 'Robertson', 'Robinson', 'Rogers', 'Rose', 'Ross', 'Russell',
|
|
|
88 |
'Saunders', 'Scott', 'Shaw', 'Simpson', 'Smith', 'Stevens', 'Stewart',
|
|
|
89 |
'Taylor', 'Thomas', 'Thompson', 'Turner',
|
|
|
90 |
'Walker', 'Walsh', 'Ward', 'Watson', 'White', 'Wilkinson', 'Williams', 'Wilson', 'Wood', 'Wright',
|
|
|
91 |
'Young',
|
|
|
92 |
];
|
|
|
93 |
|
|
|
94 |
/**
|
|
|
95 |
* Generates a random National Insurance number.
|
|
|
96 |
*
|
|
|
97 |
* @see https://www.gov.uk/hmrc-internal-manuals/national-insurance-manual/nim39110
|
|
|
98 |
*/
|
|
|
99 |
public function nino(): string
|
|
|
100 |
{
|
|
|
101 |
$prefixAllowList = ['A', 'B', 'C', 'E', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'W', 'X', 'Y', 'Z'];
|
|
|
102 |
$prefixBanList = ['BG', 'GB', 'KN', 'NK', 'NT', 'TN', 'ZZ'];
|
|
|
103 |
|
|
|
104 |
do {
|
|
|
105 |
$prefix = implode('', self::randomElements($prefixAllowList, 2, true));
|
|
|
106 |
} while (in_array($prefix, $prefixBanList, false) || $prefix[1] == 'O');
|
|
|
107 |
|
|
|
108 |
$digits = static::numerify('######');
|
|
|
109 |
$suffix = static::randomElement(['A', 'B', 'C', 'D']);
|
|
|
110 |
|
|
|
111 |
return sprintf('%s%s%s', $prefix, $digits, $suffix);
|
|
|
112 |
}
|
|
|
113 |
}
|