From edfc5302d8cf746bad18499edf4c7f08b21bc6b8 Mon Sep 17 00:00:00 2001 From: Matt Lody Date: Mon, 17 Oct 2011 20:16:58 +0100 Subject: [PATCH 01/13] Added initial en_GB files from en_US --- src/Faker/Provider/en_GB/Address.php | 103 +++++++++++++++++++++++ src/Faker/Provider/en_GB/Company.php | 66 +++++++++++++++ src/Faker/Provider/en_GB/Name.php | 95 +++++++++++++++++++++ src/Faker/Provider/en_GB/PhoneNumber.php | 35 ++++++++ 4 files changed, 299 insertions(+) create mode 100644 src/Faker/Provider/en_GB/Address.php create mode 100644 src/Faker/Provider/en_GB/Company.php create mode 100644 src/Faker/Provider/en_GB/Name.php create mode 100644 src/Faker/Provider/en_GB/PhoneNumber.php diff --git a/src/Faker/Provider/en_GB/Address.php b/src/Faker/Provider/en_GB/Address.php new file mode 100644 index 0000000000..b3206ed16d --- /dev/null +++ b/src/Faker/Provider/en_GB/Address.php @@ -0,0 +1,103 @@ + Date: Mon, 17 Oct 2011 20:19:41 +0100 Subject: [PATCH 02/13] Changed postcode() function to use bothify() instead of numerify() so that GB-style postcodes containing letters can be used --- src/Faker/Provider/Address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Faker/Provider/Address.php b/src/Faker/Provider/Address.php index 14ea0d82fd..c0bf67a983 100644 --- a/src/Faker/Provider/Address.php +++ b/src/Faker/Provider/Address.php @@ -81,7 +81,7 @@ public function streetAddress() */ public static function postcode() { - return static::numerify(static::randomElement(static::$postcode)); + return static::bothify(static::randomElement(static::$postcode)); } /** From cf73d81a87b94ed36e4f70cd87a73475d99dee3a Mon Sep 17 00:00:00 2001 From: Matt Lody Date: Mon, 17 Oct 2011 20:25:20 +0100 Subject: [PATCH 03/13] Updated street suffixes --- src/Faker/Provider/en_GB/Address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Faker/Provider/en_GB/Address.php b/src/Faker/Provider/en_GB/Address.php index b3206ed16d..b59500072c 100644 --- a/src/Faker/Provider/en_GB/Address.php +++ b/src/Faker/Provider/en_GB/Address.php @@ -10,7 +10,7 @@ class Address extends \Faker\Provider\Address protected static $citySuffix = array('town', 'ton', 'land', 'ville', 'berg', 'burgh', 'borough', 'bury', 'view', 'port', 'mouth', 'stad', 'furt', 'chester', 'mouth', 'fort', 'haven', 'side', 'shire'); protected static $buildingNumber = array('#####', '####', '###'); protected static $streetSuffix = array( - 'Alley','Avenue','Branch','Bridge','Brook','Brooks','Burg','Burgs','Bypass','Camp','Canyon','Cape','Causeway','Center','Centers','Circle','Circles','Cliff','Cliffs','Club','Common','Corner','Corners','Course','Court','Courts','Cove','Coves','Creek','Crescent','Crest','Crossing','Crossroad','Curve','Dale','Dam','Divide','Drive','Drive','Drives','Estate','Estates','Expressway','Extension','Extensions','Fall','Falls','Ferry','Field','Fields','Flat','Flats','Ford','Fords','Forest','Forge','Forges','Fork','Forks','Fort','Freeway','Garden','Gardens','Gateway','Glen','Glens','Green','Greens','Grove','Groves','Harbor','Harbors','Haven','Heights','Highway','Hill','Hills','Hollow','Inlet','Inlet','Island','Island','Islands','Islands','Isle','Isle','Junction','Junctions','Key','Keys','Knoll','Knolls','Lake','Lakes','Land','Landing','Lane','Light','Lights','Loaf','Lock','Locks','Locks','Lodge','Lodge','Loop','Mall','Manor','Manors','Meadow','Meadows','Mews','Mill','Mills','Mission','Mission','Motorway','Mount','Mountain','Mountain','Mountains','Mountains','Neck','Orchard','Oval','Overpass','Park','Parks','Parkway','Parkways','Pass','Passage','Path','Pike','Pine','Pines','Place','Plain','Plains','Plains','Plaza','Plaza','Point','Points','Port','Port','Ports','Ports','Prairie','Prairie','Radial','Ramp','Ranch','Rapid','Rapids','Rest','Ridge','Ridges','River','Road','Road','Roads','Roads','Route','Row','Rue','Run','Shoal','Shoals','Shore','Shores','Skyway','Spring','Springs','Springs','Spur','Spurs','Square','Square','Squares','Squares','Station','Station','Stravenue','Stravenue','Stream','Stream','Street','Street','Streets','Summit','Summit','Terrace','Throughway','Trace','Track','Trafficway','Trail','Trail','Tunnel','Tunnel','Turnpike','Turnpike','Underpass','Union','Unions','Valley','Valleys','Via','Viaduct','View','Views','Village','Village','Villages','Ville','Vista','Vista','Walk','Walks','Wall','Way','Ways','Well','Wells' + 'Alley','Avenue','Branch','Bridge','Brook','Brooks','Burg','Burgs','Bypass','Camp','Canyon','Cape','Causeway','Center','Centers','Circle','Circles','Cliff','Cliffs','Club','Common','Corner','Corners','Course','Court','Courts','Cove','Coves','Creek','Crescent','Crest','Crossing','Crossroad','Curve','Dale','Dam','Divide','Drive','Drive','Drives','Estate','Estates','Expressway','Extension','Extensions','Fall','Falls','Ferry','Field','Fields','Flat','Flats','Ford','Fords','Forest','Forge','Forges','Fork','Forks','Fort','Garden','Gardens','Gateway','Glen','Glens','Green','Greens','Grove','Groves','Harbour','Harbours','Haven','Heights','Highway','Hill','Hills','Hollow','Inlet', 'Island','Islands', 'Isle','Junction','Junctions','Key','Keys','Knoll','Knolls','Lake','Lakes','Land','Landing','Lane','Light','Lights','Loaf','Lock','Locks','Locks','Lodge','Lodge','Loop','Manor','Manors','Meadow','Meadows','Mews','Mill','Mills','Motorway','Mount','Mountain','Mountains','Neck','Orchard','Oval','Overpass','Park','Parks','Parkway','Parkways','Pass','Passage','Path','Pike','Pine','Pines','Place','Plain','Plains','Plaza','Point','Points','Port','Ports','Radial','Ramp','Ranch','Rapid','Rapids','Rest','Ridge','Ridges','River','Road','Road','Roads','Roads','Route','Row','Rue','Run','Shoal','Shoals','Shore','Shores','Spring','Springs','Springs','Spur','Spurs','Square','Square','Squares','Squares','Station','Station','Stream','Stream','Street','Streets','Summit','Terrace','Throughway','Trace','Track','Trafficway','Trail','Tunnel','Turnpike','Underpass','Union','Unions','Valley','Valleys','Via','Viaduct','View','Views','Village','Villages','Ville','Vista','Vista','Walk','Walks','Wall','Way','Ways','Well','Wells' ); protected static $postcode = array('#####', '#####-####'); protected static $state = array( From d934904056995803e4dd4c854921915cd2611495 Mon Sep 17 00:00:00 2001 From: Matt Lody Date: Mon, 17 Oct 2011 20:38:07 +0100 Subject: [PATCH 04/13] Added UK counties --- src/Faker/Provider/en_GB/Address.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Faker/Provider/en_GB/Address.php b/src/Faker/Provider/en_GB/Address.php index b59500072c..0779e6fe6b 100644 --- a/src/Faker/Provider/en_GB/Address.php +++ b/src/Faker/Provider/en_GB/Address.php @@ -17,8 +17,11 @@ class Address extends \Faker\Provider\Address 'Alabama','Alaska','Arizona','Arkansas','California','Colorado','Connecticut','Delaware','Florida','Georgia','Hawaii','Idaho','Illinois','Indiana','Iowa','Kansas','Kentucky','Louisiana','Maine','Maryland','Massachusetts','Michigan','Minnesota','Mississippi','Missouri','Montana','Nebraska','Nevada','NewHampshire','NewJersey','NewMexico','NewYork','NorthCarolina','NorthDakota','Ohio','Oklahoma','Oregon','Pennsylvania','RhodeIsland','SouthCarolina','SouthDakota','Tennessee','Texas','Utah','Vermont','Virginia','Washington','WestVirginia','Wisconsin','Wyoming' ); protected static $county = array( - 'Alabama','Alaska','Arizona','Arkansas','California','Colorado','Connecticut','Delaware','Florida','Georgia','Hawaii','Idaho','Illinois','Indiana','Iowa','Kansas','Kentucky','Louisiana','Maine','Maryland','Massachusetts','Michigan','Minnesota','Mississippi','Missouri','Montana','Nebraska','Nevada','NewHampshire','NewJersey','NewMexico','NewYork','NorthCarolina','NorthDakota','Ohio','Oklahoma','Oregon','Pennsylvania','RhodeIsland','SouthCarolina','SouthDakota','Tennessee','Texas','Utah','Vermont','Virginia','Washington','WestVirginia','Wisconsin','Wyoming' + 'Aberdeenshire', 'Anglesey', 'Angus', 'Argyll', 'Ayrshire', 'Banffshire', 'Bedfordshire', 'Berwickshire', 'Breconshire', 'Buckinghamshire', 'Bute', 'Caernarvonshire', 'Caithness', 'Cambridgeshire', 'Cardiganshire', 'Carmarthenshire', 'Cheshire', 'Clackmannanshire', 'Cornwall', 'Isles of Scilly', 'Cumbria', 'Denbighshire', 'Derbyshire', 'Devon', 'Dorset', 'Dumbartonshire', 'Dumfriesshire', 'Durham', 'East Lothian', 'East Sussex', 'Essex', 'Fife', 'Flintshire', 'Glamorgan', 'Gloucestershire', 'Greater London', 'Greater Manchester', 'Hampshire', 'Hertfordshire', 'Inverness', 'Kent', 'Kincardineshire', 'Kinross-shire', 'Kirkcudbrightshire', 'Lanarkshire', 'Lancashire', 'Leicestershire', 'Lincolnshire', 'London', 'Merionethshire', 'Merseyside', 'Midlothian', 'Monmouthshire', 'Montgomeryshire', 'Moray', 'Nairnshire', 'Norfolk', 'North Yorkshire', 'Northamptonshire', 'Northumberland', 'Nottinghamshire', 'Orkney', 'Oxfordshire', 'Peebleshire', 'Pembrokeshire', 'Perthshire', 'Radnorshire', 'Renfrewshire', 'Ross & Cromarty', 'Roxburghshire', 'Selkirkshire', 'Shetland', 'Shropshire', 'Somerset', 'South Yorkshire', 'Staffordshire', 'Stirlingshire', 'Suffolk', 'Surrey', 'Sutherland', 'Tyne and Wear', 'Warwickshire', 'West Lothian', 'West Midlands', 'West Sussex', 'West Yorkshire', 'Wigtownshire', 'Wiltshire', 'Worcestershire' ); + + + protected static $stateAbbr = array( 'AL','AK','AS','AZ','AR','CA','CO','CT','DE','DC','FM','FL','GA','GU','HI','ID','IL','IN','IA','KS','KY','LA','ME','MH','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','MP','OH','OK','OR','PW','PA','PR','RI','SC','SD','TN','TX','UT','VT','VI','VA','WA','WV','WI','WY','AE','AA','AP' ); @@ -89,7 +92,7 @@ public static function secondaryAddress() */ public static function county() { - return static::randomElement(static::$state); + return static::randomElement(static::$county); } /** From 5473a8f5af5f8d2f21e30aaec5d89dfc9d0555f1 Mon Sep 17 00:00:00 2001 From: Matt Lody Date: Mon, 17 Oct 2011 20:39:43 +0100 Subject: [PATCH 05/13] Removed references to states from Address class --- src/Faker/Provider/en_GB/Address.php | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/Faker/Provider/en_GB/Address.php b/src/Faker/Provider/en_GB/Address.php index 0779e6fe6b..8dcaa81a52 100644 --- a/src/Faker/Provider/en_GB/Address.php +++ b/src/Faker/Provider/en_GB/Address.php @@ -13,18 +13,11 @@ class Address extends \Faker\Provider\Address 'Alley','Avenue','Branch','Bridge','Brook','Brooks','Burg','Burgs','Bypass','Camp','Canyon','Cape','Causeway','Center','Centers','Circle','Circles','Cliff','Cliffs','Club','Common','Corner','Corners','Course','Court','Courts','Cove','Coves','Creek','Crescent','Crest','Crossing','Crossroad','Curve','Dale','Dam','Divide','Drive','Drive','Drives','Estate','Estates','Expressway','Extension','Extensions','Fall','Falls','Ferry','Field','Fields','Flat','Flats','Ford','Fords','Forest','Forge','Forges','Fork','Forks','Fort','Garden','Gardens','Gateway','Glen','Glens','Green','Greens','Grove','Groves','Harbour','Harbours','Haven','Heights','Highway','Hill','Hills','Hollow','Inlet', 'Island','Islands', 'Isle','Junction','Junctions','Key','Keys','Knoll','Knolls','Lake','Lakes','Land','Landing','Lane','Light','Lights','Loaf','Lock','Locks','Locks','Lodge','Lodge','Loop','Manor','Manors','Meadow','Meadows','Mews','Mill','Mills','Motorway','Mount','Mountain','Mountains','Neck','Orchard','Oval','Overpass','Park','Parks','Parkway','Parkways','Pass','Passage','Path','Pike','Pine','Pines','Place','Plain','Plains','Plaza','Point','Points','Port','Ports','Radial','Ramp','Ranch','Rapid','Rapids','Rest','Ridge','Ridges','River','Road','Road','Roads','Roads','Route','Row','Rue','Run','Shoal','Shoals','Shore','Shores','Spring','Springs','Springs','Spur','Spurs','Square','Square','Squares','Squares','Station','Station','Stream','Stream','Street','Streets','Summit','Terrace','Throughway','Trace','Track','Trafficway','Trail','Tunnel','Turnpike','Underpass','Union','Unions','Valley','Valleys','Via','Viaduct','View','Views','Village','Villages','Ville','Vista','Vista','Walk','Walks','Wall','Way','Ways','Well','Wells' ); protected static $postcode = array('#####', '#####-####'); - protected static $state = array( - 'Alabama','Alaska','Arizona','Arkansas','California','Colorado','Connecticut','Delaware','Florida','Georgia','Hawaii','Idaho','Illinois','Indiana','Iowa','Kansas','Kentucky','Louisiana','Maine','Maryland','Massachusetts','Michigan','Minnesota','Mississippi','Missouri','Montana','Nebraska','Nevada','NewHampshire','NewJersey','NewMexico','NewYork','NorthCarolina','NorthDakota','Ohio','Oklahoma','Oregon','Pennsylvania','RhodeIsland','SouthCarolina','SouthDakota','Tennessee','Texas','Utah','Vermont','Virginia','Washington','WestVirginia','Wisconsin','Wyoming' - ); + protected static $county = array( 'Aberdeenshire', 'Anglesey', 'Angus', 'Argyll', 'Ayrshire', 'Banffshire', 'Bedfordshire', 'Berwickshire', 'Breconshire', 'Buckinghamshire', 'Bute', 'Caernarvonshire', 'Caithness', 'Cambridgeshire', 'Cardiganshire', 'Carmarthenshire', 'Cheshire', 'Clackmannanshire', 'Cornwall', 'Isles of Scilly', 'Cumbria', 'Denbighshire', 'Derbyshire', 'Devon', 'Dorset', 'Dumbartonshire', 'Dumfriesshire', 'Durham', 'East Lothian', 'East Sussex', 'Essex', 'Fife', 'Flintshire', 'Glamorgan', 'Gloucestershire', 'Greater London', 'Greater Manchester', 'Hampshire', 'Hertfordshire', 'Inverness', 'Kent', 'Kincardineshire', 'Kinross-shire', 'Kirkcudbrightshire', 'Lanarkshire', 'Lancashire', 'Leicestershire', 'Lincolnshire', 'London', 'Merionethshire', 'Merseyside', 'Midlothian', 'Monmouthshire', 'Montgomeryshire', 'Moray', 'Nairnshire', 'Norfolk', 'North Yorkshire', 'Northamptonshire', 'Northumberland', 'Nottinghamshire', 'Orkney', 'Oxfordshire', 'Peebleshire', 'Pembrokeshire', 'Perthshire', 'Radnorshire', 'Renfrewshire', 'Ross & Cromarty', 'Roxburghshire', 'Selkirkshire', 'Shetland', 'Shropshire', 'Somerset', 'South Yorkshire', 'Staffordshire', 'Stirlingshire', 'Suffolk', 'Surrey', 'Sutherland', 'Tyne and Wear', 'Warwickshire', 'West Lothian', 'West Midlands', 'West Sussex', 'West Yorkshire', 'Wigtownshire', 'Wiltshire', 'Worcestershire' ); - - - protected static $stateAbbr = array( - 'AL','AK','AS','AZ','AR','CA','CO','CT','DE','DC','FM','FL','GA','GU','HI','ID','IL','IN','IA','KS','KY','LA','ME','MH','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','MP','OH','OK','OR','PW','PA','PR','RI','SC','SD','TN','TX','UT','VT','VI','VA','WA','WV','WI','WY','AE','AA','AP' - ); protected static $country = array( 'Afghanistan','Albania','Algeria','American Samoa','Andorra','Angola','Anguilla','Antarctica (the territory South of 60 deg S)','Antigua and Barbuda','Argentina','Armenia','Aruba','Australia','Austria','Azerbaijan', 'Bahamas','Bahrain','Bangladesh','Barbados','Belarus','Belgium','Belize','Benin','Bermuda','Bhutan','Bolivia','Bosnia and Herzegovina','Botswana','Bouvet Island (Bouvetoya)','Brazil','British Indian Ocean Territory (Chagos Archipelago)','British Virgin Islands','Brunei Darussalam','Bulgaria','Burkina Faso','Burundi', @@ -67,7 +60,7 @@ class Address extends \Faker\Provider\Address '{{buildingNumber}} {{streetName}} {{secondaryAddress}}', ); protected static $addressFormats = array( - "{{streetAddress}}\n{{city}}, {{stateAbbr}} {{postcode}}", + "{{streetAddress}}\n{{city}}, {{postcode}}", ); protected static $secondaryAddressFormats = array('Flat ###', 'Studio ###'); @@ -80,7 +73,7 @@ public static function cityPrefix() } /** - * @example 'Appt. 350' + * @example 'Flat 350' */ public static function secondaryAddress() { @@ -94,13 +87,5 @@ public static function county() { return static::randomElement(static::$county); } - - /** - * @example 'CA' - */ - public static function stateAbbr() - { - return static::randomElement(static::$stateAbbr); - } } \ No newline at end of file From 52897b8b521d4083976035b920c88ed9620f9c18 Mon Sep 17 00:00:00 2001 From: Matt Lody Date: Mon, 17 Oct 2011 20:44:33 +0100 Subject: [PATCH 06/13] Added UK postcode formats - as per wikipedia definition --- src/Faker/Provider/en_GB/Address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Faker/Provider/en_GB/Address.php b/src/Faker/Provider/en_GB/Address.php index 8dcaa81a52..127815ed27 100644 --- a/src/Faker/Provider/en_GB/Address.php +++ b/src/Faker/Provider/en_GB/Address.php @@ -12,7 +12,7 @@ class Address extends \Faker\Provider\Address protected static $streetSuffix = array( 'Alley','Avenue','Branch','Bridge','Brook','Brooks','Burg','Burgs','Bypass','Camp','Canyon','Cape','Causeway','Center','Centers','Circle','Circles','Cliff','Cliffs','Club','Common','Corner','Corners','Course','Court','Courts','Cove','Coves','Creek','Crescent','Crest','Crossing','Crossroad','Curve','Dale','Dam','Divide','Drive','Drive','Drives','Estate','Estates','Expressway','Extension','Extensions','Fall','Falls','Ferry','Field','Fields','Flat','Flats','Ford','Fords','Forest','Forge','Forges','Fork','Forks','Fort','Garden','Gardens','Gateway','Glen','Glens','Green','Greens','Grove','Groves','Harbour','Harbours','Haven','Heights','Highway','Hill','Hills','Hollow','Inlet', 'Island','Islands', 'Isle','Junction','Junctions','Key','Keys','Knoll','Knolls','Lake','Lakes','Land','Landing','Lane','Light','Lights','Loaf','Lock','Locks','Locks','Lodge','Lodge','Loop','Manor','Manors','Meadow','Meadows','Mews','Mill','Mills','Motorway','Mount','Mountain','Mountains','Neck','Orchard','Oval','Overpass','Park','Parks','Parkway','Parkways','Pass','Passage','Path','Pike','Pine','Pines','Place','Plain','Plains','Plaza','Point','Points','Port','Ports','Radial','Ramp','Ranch','Rapid','Rapids','Rest','Ridge','Ridges','River','Road','Road','Roads','Roads','Route','Row','Rue','Run','Shoal','Shoals','Shore','Shores','Spring','Springs','Springs','Spur','Spurs','Square','Square','Squares','Squares','Station','Station','Stream','Stream','Street','Streets','Summit','Terrace','Throughway','Trace','Track','Trafficway','Trail','Tunnel','Turnpike','Underpass','Union','Unions','Valley','Valleys','Via','Viaduct','View','Views','Village','Villages','Ville','Vista','Vista','Walk','Walks','Wall','Way','Ways','Well','Wells' ); - protected static $postcode = array('#####', '#####-####'); + protected static $postcode = array('?# #??', '?## #??', '??# #??', '??## #??', '?#? #??', '??#? #??'); protected static $county = array( 'Aberdeenshire', 'Anglesey', 'Angus', 'Argyll', 'Ayrshire', 'Banffshire', 'Bedfordshire', 'Berwickshire', 'Breconshire', 'Buckinghamshire', 'Bute', 'Caernarvonshire', 'Caithness', 'Cambridgeshire', 'Cardiganshire', 'Carmarthenshire', 'Cheshire', 'Clackmannanshire', 'Cornwall', 'Isles of Scilly', 'Cumbria', 'Denbighshire', 'Derbyshire', 'Devon', 'Dorset', 'Dumbartonshire', 'Dumfriesshire', 'Durham', 'East Lothian', 'East Sussex', 'Essex', 'Fife', 'Flintshire', 'Glamorgan', 'Gloucestershire', 'Greater London', 'Greater Manchester', 'Hampshire', 'Hertfordshire', 'Inverness', 'Kent', 'Kincardineshire', 'Kinross-shire', 'Kirkcudbrightshire', 'Lanarkshire', 'Lancashire', 'Leicestershire', 'Lincolnshire', 'London', 'Merionethshire', 'Merseyside', 'Midlothian', 'Monmouthshire', 'Montgomeryshire', 'Moray', 'Nairnshire', 'Norfolk', 'North Yorkshire', 'Northamptonshire', 'Northumberland', 'Nottinghamshire', 'Orkney', 'Oxfordshire', 'Peebleshire', 'Pembrokeshire', 'Perthshire', 'Radnorshire', 'Renfrewshire', 'Ross & Cromarty', 'Roxburghshire', 'Selkirkshire', 'Shetland', 'Shropshire', 'Somerset', 'South Yorkshire', 'Staffordshire', 'Stirlingshire', 'Suffolk', 'Surrey', 'Sutherland', 'Tyne and Wear', 'Warwickshire', 'West Lothian', 'West Midlands', 'West Sussex', 'West Yorkshire', 'Wigtownshire', 'Wiltshire', 'Worcestershire' From 24533417c39783b4fdc633d412e89a1a24d87a98 Mon Sep 17 00:00:00 2001 From: Matt Lody Date: Mon, 17 Oct 2011 20:57:51 +0100 Subject: [PATCH 07/13] Added en_GB PhoneNumber provider --- src/Faker/Provider/en_GB/PhoneNumber.php | 35 ++++++++---------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/src/Faker/Provider/en_GB/PhoneNumber.php b/src/Faker/Provider/en_GB/PhoneNumber.php index 36a4c584b5..6430feb71e 100644 --- a/src/Faker/Provider/en_GB/PhoneNumber.php +++ b/src/Faker/Provider/en_GB/PhoneNumber.php @@ -1,35 +1,22 @@ Date: Mon, 17 Oct 2011 21:12:34 +0100 Subject: [PATCH 08/13] Fixed bug to make postcodes uppercase --- src/Faker/Provider/Address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Faker/Provider/Address.php b/src/Faker/Provider/Address.php index c0bf67a983..8f28712698 100644 --- a/src/Faker/Provider/Address.php +++ b/src/Faker/Provider/Address.php @@ -81,7 +81,7 @@ public function streetAddress() */ public static function postcode() { - return static::bothify(static::randomElement(static::$postcode)); + return strtoupper(static::bothify(static::randomElement(static::$postcode))); } /** From dc9e7ae8e6e2ed2bfd0825f2ae004aadb60b358d Mon Sep 17 00:00:00 2001 From: Matt Lody Date: Mon, 17 Oct 2011 21:14:30 +0100 Subject: [PATCH 09/13] Made building numbers more reasonable --- src/Faker/Provider/en_GB/Address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Faker/Provider/en_GB/Address.php b/src/Faker/Provider/en_GB/Address.php index 127815ed27..af5fafa21b 100644 --- a/src/Faker/Provider/en_GB/Address.php +++ b/src/Faker/Provider/en_GB/Address.php @@ -8,7 +8,7 @@ class Address extends \Faker\Provider\Address { protected static $cityPrefix = array('North', 'East', 'West', 'South', 'New', 'Lake', 'Port'); protected static $citySuffix = array('town', 'ton', 'land', 'ville', 'berg', 'burgh', 'borough', 'bury', 'view', 'port', 'mouth', 'stad', 'furt', 'chester', 'mouth', 'fort', 'haven', 'side', 'shire'); - protected static $buildingNumber = array('#####', '####', '###'); + protected static $buildingNumber = array('###', '##', '#'); protected static $streetSuffix = array( 'Alley','Avenue','Branch','Bridge','Brook','Brooks','Burg','Burgs','Bypass','Camp','Canyon','Cape','Causeway','Center','Centers','Circle','Circles','Cliff','Cliffs','Club','Common','Corner','Corners','Course','Court','Courts','Cove','Coves','Creek','Crescent','Crest','Crossing','Crossroad','Curve','Dale','Dam','Divide','Drive','Drive','Drives','Estate','Estates','Expressway','Extension','Extensions','Fall','Falls','Ferry','Field','Fields','Flat','Flats','Ford','Fords','Forest','Forge','Forges','Fork','Forks','Fort','Garden','Gardens','Gateway','Glen','Glens','Green','Greens','Grove','Groves','Harbour','Harbours','Haven','Heights','Highway','Hill','Hills','Hollow','Inlet', 'Island','Islands', 'Isle','Junction','Junctions','Key','Keys','Knoll','Knolls','Lake','Lakes','Land','Landing','Lane','Light','Lights','Loaf','Lock','Locks','Locks','Lodge','Lodge','Loop','Manor','Manors','Meadow','Meadows','Mews','Mill','Mills','Motorway','Mount','Mountain','Mountains','Neck','Orchard','Oval','Overpass','Park','Parks','Parkway','Parkways','Pass','Passage','Path','Pike','Pine','Pines','Place','Plain','Plains','Plaza','Point','Points','Port','Ports','Radial','Ramp','Ranch','Rapid','Rapids','Rest','Ridge','Ridges','River','Road','Road','Roads','Roads','Route','Row','Rue','Run','Shoal','Shoals','Shore','Shores','Spring','Springs','Springs','Spur','Spurs','Square','Square','Squares','Squares','Station','Station','Stream','Stream','Street','Streets','Summit','Terrace','Throughway','Trace','Track','Trafficway','Trail','Tunnel','Turnpike','Underpass','Union','Unions','Valley','Valleys','Via','Viaduct','View','Views','Village','Villages','Ville','Vista','Vista','Walk','Walks','Wall','Way','Ways','Well','Wells' ); From 853896dc7f1e0aca11da7275bb13e2631baae225 Mon Sep 17 00:00:00 2001 From: Matt Lody Date: Mon, 17 Oct 2011 21:15:50 +0100 Subject: [PATCH 10/13] Added ability for letter names in flats, such as 324a --- src/Faker/Provider/en_GB/Address.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Faker/Provider/en_GB/Address.php b/src/Faker/Provider/en_GB/Address.php index af5fafa21b..d3959316dd 100644 --- a/src/Faker/Provider/en_GB/Address.php +++ b/src/Faker/Provider/en_GB/Address.php @@ -62,7 +62,7 @@ class Address extends \Faker\Provider\Address protected static $addressFormats = array( "{{streetAddress}}\n{{city}}, {{postcode}}", ); - protected static $secondaryAddressFormats = array('Flat ###', 'Studio ###'); + protected static $secondaryAddressFormats = array('Flat ##', 'Flat ##?', 'Studio ##', 'Studio ##?'); /** * @example 'East' @@ -77,7 +77,7 @@ public static function cityPrefix() */ public static function secondaryAddress() { - return static::numerify(static::randomElement(static::$secondaryAddressFormats)); + return static::bothify(static::randomElement(static::$secondaryAddressFormats)); } /** From 3f500ff4991901bcd20a834520d0a2f95a21e03c Mon Sep 17 00:00:00 2001 From: Matt Lody Date: Mon, 17 Oct 2011 21:25:00 +0100 Subject: [PATCH 11/13] Changed address formatting to match en_GB locale --- src/Faker/Provider/en_GB/Address.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Faker/Provider/en_GB/Address.php b/src/Faker/Provider/en_GB/Address.php index d3959316dd..51659c6926 100644 --- a/src/Faker/Provider/en_GB/Address.php +++ b/src/Faker/Provider/en_GB/Address.php @@ -57,10 +57,11 @@ class Address extends \Faker\Provider\Address ); protected static $streetAddressFormats = array( '{{buildingNumber}} {{streetName}}', - '{{buildingNumber}} {{streetName}} {{secondaryAddress}}', + '{{buildingNumber}} {{streetName}}', + "{{secondaryAddress}}\n{{streetName}}", ); protected static $addressFormats = array( - "{{streetAddress}}\n{{city}}, {{postcode}}", + "{{streetAddress}}\n{{city}}\n{{postcode}}", ); protected static $secondaryAddressFormats = array('Flat ##', 'Flat ##?', 'Studio ##', 'Studio ##?'); From 4c07fa0bb29322c59df4851229535d4c3345d353 Mon Sep 17 00:00:00 2001 From: Matt Lody Date: Mon, 17 Oct 2011 21:35:45 +0100 Subject: [PATCH 12/13] Added .co.uk domains to Internet provider --- src/Faker/Provider/en_GB/DateTime.php | 157 ++++++++++++++++++++++++++ src/Faker/Provider/en_GB/Internet.php | 12 ++ 2 files changed, 169 insertions(+) create mode 100644 src/Faker/Provider/en_GB/DateTime.php create mode 100644 src/Faker/Provider/en_GB/Internet.php diff --git a/src/Faker/Provider/en_GB/DateTime.php b/src/Faker/Provider/en_GB/DateTime.php new file mode 100644 index 0000000000..c3ad63c580 --- /dev/null +++ b/src/Faker/Provider/en_GB/DateTime.php @@ -0,0 +1,157 @@ +format($format); + } + + /** + * @example '15:02:34' + */ + public static function time($format = 'H:i:s') + { + return static::dateTime()->format($format); + } + + /** + * @example DateTime('1999-02-02 11:42:52') + * @return \DateTime + */ + public static function dateTimeBetween($startDate = "-30 years", $endDate = "now") + { + $startTimestamp = strtotime($startDate); + $endTimestamp = strtotime($endDate); + $timestamp = mt_rand($startTimestamp, $endTimestamp); + + return new \DateTime('@' . $timestamp); + } + + /** + * @example DateTime('1964-04-04 11:02:02') + * @return \DateTime + */ + public static function dateTimeThisCentury() + { + return static::dateTimeBetween("-100 year"); + } + + /** + * @example DateTime('2010-03-10 05:18:58') + * @return \DateTime + */ + public static function dateTimeThisDecade() + { + return static::dateTimeBetween("-10 year"); + } + + /** + * @example DateTime('2011-09-19 09:24:37') + * @return \DateTime + */ + public static function dateTimeThisYear() + { + return static::dateTimeBetween("-1 year"); + } + + /** + * @example DateTime('2011-10-05 12:51:46') + * @return \DateTime + */ + public static function dateTimeThisMonth() + { + return static::dateTimeBetween("-1 month"); + } + + /** + * @example 'am' + */ + public static function amPm() + { + return static::dateTime()->format('a'); + } + + /** + * @example '22' + */ + public static function dayOfMonth() + { + return static::dateTime()->format('d'); + } + + /** + * @example 'Tuesday' + */ + public static function dayOfWeek() + { + return static::dateTime()->format('l'); + } + + /** + * @example '7' + */ + public static function month() + { + return static::dateTime()->format('m'); + } + + /** + * @example 'September' + */ + public static function monthName() + { + return static::dateTime()->format('F'); + } + + /** + * @example 1673 + */ + public static function year() + { + return static::dateTime()->format('Y'); + } + + /** + * @example 'XVII' + */ + public static function century() + { + return static::randomElement(static::$century); + } + +} \ No newline at end of file diff --git a/src/Faker/Provider/en_GB/Internet.php b/src/Faker/Provider/en_GB/Internet.php new file mode 100644 index 0000000000..ba29859eef --- /dev/null +++ b/src/Faker/Provider/en_GB/Internet.php @@ -0,0 +1,12 @@ + Date: Mon, 17 Oct 2011 21:46:26 +0100 Subject: [PATCH 13/13] Removed unnecessary files --- src/Faker/Provider/en_GB/Company.php | 66 ----------- src/Faker/Provider/en_GB/DateTime.php | 157 -------------------------- src/Faker/Provider/en_GB/Name.php | 95 ---------------- 3 files changed, 318 deletions(-) delete mode 100644 src/Faker/Provider/en_GB/Company.php delete mode 100644 src/Faker/Provider/en_GB/DateTime.php delete mode 100644 src/Faker/Provider/en_GB/Name.php diff --git a/src/Faker/Provider/en_GB/Company.php b/src/Faker/Provider/en_GB/Company.php deleted file mode 100644 index 9021dbeb09..0000000000 --- a/src/Faker/Provider/en_GB/Company.php +++ /dev/null @@ -1,66 +0,0 @@ -format($format); - } - - /** - * @example '15:02:34' - */ - public static function time($format = 'H:i:s') - { - return static::dateTime()->format($format); - } - - /** - * @example DateTime('1999-02-02 11:42:52') - * @return \DateTime - */ - public static function dateTimeBetween($startDate = "-30 years", $endDate = "now") - { - $startTimestamp = strtotime($startDate); - $endTimestamp = strtotime($endDate); - $timestamp = mt_rand($startTimestamp, $endTimestamp); - - return new \DateTime('@' . $timestamp); - } - - /** - * @example DateTime('1964-04-04 11:02:02') - * @return \DateTime - */ - public static function dateTimeThisCentury() - { - return static::dateTimeBetween("-100 year"); - } - - /** - * @example DateTime('2010-03-10 05:18:58') - * @return \DateTime - */ - public static function dateTimeThisDecade() - { - return static::dateTimeBetween("-10 year"); - } - - /** - * @example DateTime('2011-09-19 09:24:37') - * @return \DateTime - */ - public static function dateTimeThisYear() - { - return static::dateTimeBetween("-1 year"); - } - - /** - * @example DateTime('2011-10-05 12:51:46') - * @return \DateTime - */ - public static function dateTimeThisMonth() - { - return static::dateTimeBetween("-1 month"); - } - - /** - * @example 'am' - */ - public static function amPm() - { - return static::dateTime()->format('a'); - } - - /** - * @example '22' - */ - public static function dayOfMonth() - { - return static::dateTime()->format('d'); - } - - /** - * @example 'Tuesday' - */ - public static function dayOfWeek() - { - return static::dateTime()->format('l'); - } - - /** - * @example '7' - */ - public static function month() - { - return static::dateTime()->format('m'); - } - - /** - * @example 'September' - */ - public static function monthName() - { - return static::dateTime()->format('F'); - } - - /** - * @example 1673 - */ - public static function year() - { - return static::dateTime()->format('Y'); - } - - /** - * @example 'XVII' - */ - public static function century() - { - return static::randomElement(static::$century); - } - -} \ No newline at end of file diff --git a/src/Faker/Provider/en_GB/Name.php b/src/Faker/Provider/en_GB/Name.php deleted file mode 100644 index 14372cb4d5..0000000000 --- a/src/Faker/Provider/en_GB/Name.php +++ /dev/null @@ -1,95 +0,0 @@ -