From f1f21f62978ffe2f196a6a64e43e3c0c50655327 Mon Sep 17 00:00:00 2001 From: Jivesh Date: Tue, 3 Jan 2017 15:56:16 +0530 Subject: [PATCH 1/3] Indian states added to en_IN locale --- src/Faker/Provider/en_IN/Address.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/Faker/Provider/en_IN/Address.php b/src/Faker/Provider/en_IN/Address.php index dd8d247b7e..e6e3408981 100644 --- a/src/Faker/Provider/en_IN/Address.php +++ b/src/Faker/Provider/en_IN/Address.php @@ -4,7 +4,6 @@ class Address extends \Faker\Provider\Address { - protected static $city = array( 'Agra','Ahmedabad','Ajmer','Alwar', 'Bengaluru','Bhubhaneshwar','Bhopal','Bikaner', @@ -28,6 +27,14 @@ class Address extends \Faker\Provider\Address 'Warangal', ); + protected static $state = array( + 'Andhra Pradesh', 'Arunachal Pradesh', 'Assam', 'Bihar', 'Chhattisgarh', 'Goa', 'Gujarat', 'Haryana', 'Himachal Pradesh', 'Jammu and Kashmir', 'Jharkhand', 'Karnataka', 'Kerala', 'Madhya Pradesh', 'Maharashtra', 'Manipur', 'Meghalaya', 'Mizoram', 'Nagaland', 'Odisha', 'Punjab', 'Rajasthan', 'Sikkim', 'Tamil Nadu', 'Telangana', 'Tripura', 'Uttar Pradesh', 'Uttarakhand', 'West Bengal', 'Andaman and Nicobar Islands', 'Chandigarh', 'Dadra and Nagar Haveli', 'Daman and Diu', 'Delhi', 'Lakshadweep', 'Puducherry' + ); + + protected static $stateAbbr = array( + 'AP', 'AR', 'AS', 'BR', 'CG', 'GA', 'GJ', 'HR', 'HP', 'JK', 'JH', 'KA', 'KL', 'MP', 'MH', 'MN', 'ML', 'MZ', 'NL', 'OD', 'PB', 'RJ', 'SK', 'TN', 'TS', 'TR', 'UP', 'UK', 'WB', 'AN', 'CH', 'DN', 'DD', 'DL', 'LD', 'PY' + ); + 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', @@ -131,4 +138,20 @@ public function areaSuffix() { return static::randomElement(static::$areaSuffix); } + + /** + * @example 'Delhi' + */ + public static function state() + { + return static::randomElement(static::$state); + } + + /** + * @example 'DL' + */ + public static function stateAbbr() + { + return static::randomElement(static::$stateAbbr); + } } From cf5b8aacb6ba42331637ec2bf364da514aa3334b Mon Sep 17 00:00:00 2001 From: Jivesh Date: Thu, 5 Jan 2017 15:29:35 +0530 Subject: [PATCH 2/3] Line splitting alphabetically --- src/Faker/Provider/en_IN/Address.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/Faker/Provider/en_IN/Address.php b/src/Faker/Provider/en_IN/Address.php index e6e3408981..56f03a3adb 100644 --- a/src/Faker/Provider/en_IN/Address.php +++ b/src/Faker/Provider/en_IN/Address.php @@ -28,7 +28,32 @@ class Address extends \Faker\Provider\Address ); protected static $state = array( - 'Andhra Pradesh', 'Arunachal Pradesh', 'Assam', 'Bihar', 'Chhattisgarh', 'Goa', 'Gujarat', 'Haryana', 'Himachal Pradesh', 'Jammu and Kashmir', 'Jharkhand', 'Karnataka', 'Kerala', 'Madhya Pradesh', 'Maharashtra', 'Manipur', 'Meghalaya', 'Mizoram', 'Nagaland', 'Odisha', 'Punjab', 'Rajasthan', 'Sikkim', 'Tamil Nadu', 'Telangana', 'Tripura', 'Uttar Pradesh', 'Uttarakhand', 'West Bengal', 'Andaman and Nicobar Islands', 'Chandigarh', 'Dadra and Nagar Haveli', 'Daman and Diu', 'Delhi', 'Lakshadweep', 'Puducherry' + + // States + 'Andhra Pradesh', 'Arunachal Pradesh', 'Assam', + 'Bihar', + 'Chhattisgarh', + 'Goa', 'Gujarat', + 'Haryana', 'Himachal Pradesh', + 'Jammu and Kashmir', + 'Jharkhand', + 'Karnataka', 'Kerala', + 'Madhya Pradesh', 'Maharashtra', 'Manipur', 'Meghalaya', 'Mizoram', + 'Nagaland', + 'Odisha', + 'Punjab', + 'Rajasthan', + 'Sikkim', + 'Tamil Nadu', 'Telangana', 'Tripura', + 'Uttar Pradesh', 'Uttarakhand', + 'West Bengal', + + // Union Territories + 'Andaman and Nicobar Islands', + 'Chandigarh', + 'Dadra and Nagar Haveli', 'Daman and Diu', 'Delhi', + 'Lakshadweep', + 'Puducherry' ); protected static $stateAbbr = array( From e0d21e89f810161261ec19ef05f64f83ab53f339 Mon Sep 17 00:00:00 2001 From: Jivesh Date: Thu, 5 Jan 2017 21:44:39 +0530 Subject: [PATCH 3/3] tabs replaced with spaces --- src/Faker/Provider/en_IN/Address.php | 52 ++++++++++++++-------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Faker/Provider/en_IN/Address.php b/src/Faker/Provider/en_IN/Address.php index 56f03a3adb..0f839093b3 100644 --- a/src/Faker/Provider/en_IN/Address.php +++ b/src/Faker/Provider/en_IN/Address.php @@ -28,32 +28,32 @@ class Address extends \Faker\Provider\Address ); protected static $state = array( - - // States + + // States 'Andhra Pradesh', 'Arunachal Pradesh', 'Assam', - 'Bihar', - 'Chhattisgarh', - 'Goa', 'Gujarat', - 'Haryana', 'Himachal Pradesh', - 'Jammu and Kashmir', - 'Jharkhand', - 'Karnataka', 'Kerala', - 'Madhya Pradesh', 'Maharashtra', 'Manipur', 'Meghalaya', 'Mizoram', - 'Nagaland', - 'Odisha', - 'Punjab', - 'Rajasthan', - 'Sikkim', - 'Tamil Nadu', 'Telangana', 'Tripura', - 'Uttar Pradesh', 'Uttarakhand', - 'West Bengal', - - // Union Territories - 'Andaman and Nicobar Islands', - 'Chandigarh', - 'Dadra and Nagar Haveli', 'Daman and Diu', 'Delhi', - 'Lakshadweep', - 'Puducherry' + 'Bihar', + 'Chhattisgarh', + 'Goa', 'Gujarat', + 'Haryana', 'Himachal Pradesh', + 'Jammu and Kashmir', + 'Jharkhand', + 'Karnataka', 'Kerala', + 'Madhya Pradesh', 'Maharashtra', 'Manipur', 'Meghalaya', 'Mizoram', + 'Nagaland', + 'Odisha', + 'Punjab', + 'Rajasthan', + 'Sikkim', + 'Tamil Nadu', 'Telangana', 'Tripura', + 'Uttar Pradesh', 'Uttarakhand', + 'West Bengal', + + // Union Territories + 'Andaman and Nicobar Islands', + 'Chandigarh', + 'Dadra and Nagar Haveli', 'Daman and Diu', 'Delhi', + 'Lakshadweep', + 'Puducherry' ); protected static $stateAbbr = array( @@ -106,7 +106,7 @@ class Address extends \Faker\Provider\Address protected static $postcode = array( '1#####','2#####','3#####','4#####','5#####', ); - protected static $localityFormats = array ( + protected static $localityFormats = array( '{{firstName}}{{areaSuffix}}', '{{localityName}}' );