From af4b341fee11c5d9c880de7b9c06c0b5849d4e81 Mon Sep 17 00:00:00 2001 From: Hamlet Date: Sat, 1 Dec 2012 22:04:12 +0400 Subject: [PATCH 1/5] aster --- src/Faker/Provider/hy_AM/Address.php | 132 +++++++++++++++++++++++ src/Faker/Provider/hy_AM/Company.php | 54 ++++++++++ src/Faker/Provider/hy_AM/Internet.php | 36 +++++++ src/Faker/Provider/hy_AM/Person.php | 73 +++++++++++++ src/Faker/Provider/hy_AM/PhoneNumber.php | 37 +++++++ 5 files changed, 332 insertions(+) create mode 100644 src/Faker/Provider/hy_AM/Address.php create mode 100644 src/Faker/Provider/hy_AM/Company.php create mode 100644 src/Faker/Provider/hy_AM/Internet.php create mode 100644 src/Faker/Provider/hy_AM/Person.php create mode 100644 src/Faker/Provider/hy_AM/PhoneNumber.php diff --git a/src/Faker/Provider/hy_AM/Address.php b/src/Faker/Provider/hy_AM/Address.php new file mode 100644 index 0000000000..5f23faffd2 --- /dev/null +++ b/src/Faker/Provider/hy_AM/Address.php @@ -0,0 +1,132 @@ +generator->parse($format); + } + + public static function country() + { + return static::randomElement(static::$country); + } + + public static function postcode() + { + return static::toUpper(static::bothify(static::randomElement(static::$postcode))); + } + + public static function regionSuffix() + { + return static::randomElement(static::$regionSuffix); + } + + public static function region() + { + return static::randomElement(static::$region); + } + + public static function cityPrefix() + { + return static::randomElement(static::$cityPrefix); + } + + public static function city() + { + return static::randomElement(static::$city); + } + + public static function streetPrefix() + { + return static::randomElement(static::$streetPrefix); + } + + public static function street() + { + return static::randomElement(static::$street); + } +} diff --git a/src/Faker/Provider/hy_AM/Company.php b/src/Faker/Provider/hy_AM/Company.php new file mode 100644 index 0000000000..5019b124bb --- /dev/null +++ b/src/Faker/Provider/hy_AM/Company.php @@ -0,0 +1,54 @@ +generator->parse($format)); + } + + /** + * @example 'faber' + */ + public function domainWord() + { + $company = $this->generator->format('company'); + $companyElements = explode(' ', $company); + $company = $companyElements[0]; + $company = preg_replace('/,/', '', $company); + + // Translit for armenian language + $company = mb_strtolower($company, 'UTF-8'); + $company = str_replace( + array('ու','ա','բ','գ','դ','ե','զ','է','ը','թ','ժ','ի','լ','խ','ծ','կ','հ','ձ','ղ','ճ','մ','յ','ն','շ','ո','չ','պ','ջ','ռ','ս','վ','տ','ր','ց','փ','ք','և','օ','ֆ',), + array('u','a','b','g','d','e','z','e','y','t','zh','i','l','kh','ts','k','h','dz','gh','ch','m','y','n','sh','o','ch','p','j','r','s','v','t','r','ts','p','q','ev','o','f'),$company); + + return $company; + } +} diff --git a/src/Faker/Provider/hy_AM/Person.php b/src/Faker/Provider/hy_AM/Person.php new file mode 100644 index 0000000000..6113956e41 --- /dev/null +++ b/src/Faker/Provider/hy_AM/Person.php @@ -0,0 +1,73 @@ + Date: Sat, 1 Dec 2012 22:09:13 +0400 Subject: [PATCH 2/5] Added hy_AM --- src/Faker/Provider/hy_AM/Internet.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Faker/Provider/hy_AM/Internet.php b/src/Faker/Provider/hy_AM/Internet.php index 85d783a14f..558fc27e7f 100644 --- a/src/Faker/Provider/hy_AM/Internet.php +++ b/src/Faker/Provider/hy_AM/Internet.php @@ -29,7 +29,8 @@ public function domainWord() $company = mb_strtolower($company, 'UTF-8'); $company = str_replace( array('ու','ա','բ','գ','դ','ե','զ','է','ը','թ','ժ','ի','լ','խ','ծ','կ','հ','ձ','ղ','ճ','մ','յ','ն','շ','ո','չ','պ','ջ','ռ','ս','վ','տ','ր','ց','փ','ք','և','օ','ֆ',), - array('u','a','b','g','d','e','z','e','y','t','zh','i','l','kh','ts','k','h','dz','gh','ch','m','y','n','sh','o','ch','p','j','r','s','v','t','r','ts','p','q','ev','o','f'),$company); + array('u','a','b','g','d','e','z','e','y','t','zh','i','l','kh','ts','k','h','dz','gh','ch','m','y','n','sh','o','ch','p','j','r','s','v','t','r','ts','p','q','ev','o','f'), + $company); return $company; } From fabe75246465faba392d59d1720ecec884e38f10 Mon Sep 17 00:00:00 2001 From: Hamlet Date: Sat, 22 Dec 2012 18:15:12 +0400 Subject: [PATCH 3/5] Fixed some issues --- src/Faker/Provider/hy_AM/Address.php | 4 ++-- src/Faker/Provider/hy_AM/Person.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Faker/Provider/hy_AM/Address.php b/src/Faker/Provider/hy_AM/Address.php index 5f23faffd2..ec59f0c63d 100644 --- a/src/Faker/Provider/hy_AM/Address.php +++ b/src/Faker/Provider/hy_AM/Address.php @@ -2,7 +2,7 @@ namespace Faker\Provider\hy_AM; -class Address extends \Faker\Provider\Base +class Address extends \Faker\Provider\Address { protected static $cityPrefix = array('քաղաք','գյուղ'); @@ -76,7 +76,7 @@ class Address extends \Faker\Provider\Base protected static $addressFormats = array( "{{region}} {{regionSuffix}}, {{cityPrefix}} {{city}}, {{street}} {{buildingNumber}} {{streetPrefix}}, {{postcode}}", - //"{{country}}, {{region}} {{regionSuffix}}, {{cityPrefix}} {{city}}, {{street}} {{buildingNumber}} {{streetPrefix}}, {{postcode}}", + "{{postcode}}, {{region}} {{regionSuffix}}, {{cityPrefix}} {{city}}, {{street}} {{streetSuffix}}, {{buildingNumber}}", ); public static function buildingNumber() diff --git a/src/Faker/Provider/hy_AM/Person.php b/src/Faker/Provider/hy_AM/Person.php index 6113956e41..739ed1bea8 100644 --- a/src/Faker/Provider/hy_AM/Person.php +++ b/src/Faker/Provider/hy_AM/Person.php @@ -51,9 +51,9 @@ class Person extends \Faker\Provider\Person 'Համբարձումյան','Սարգսյան', ); - //private static $prefix = array('Mr.','Mrs.','Ms.','Miss','Dr.'); + private static $prefix = array('Պարոն',''); - //private static $suffix = array('Jr.','Sr.','I','II','III','IV','V','MD','DDS','PhD','DVM'); + private static $suffix = array('',); /** * @example 'Mrs.' From 478b95d8a3bb17b42bef83d99c8da9b69013aeb7 Mon Sep 17 00:00:00 2001 From: Hamlet Date: Sat, 22 Dec 2012 18:22:43 +0400 Subject: [PATCH 4/5] Removed one address string --- src/Faker/Provider/hy_AM/Address.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Faker/Provider/hy_AM/Address.php b/src/Faker/Provider/hy_AM/Address.php index ec59f0c63d..1fe8e71f98 100644 --- a/src/Faker/Provider/hy_AM/Address.php +++ b/src/Faker/Provider/hy_AM/Address.php @@ -76,7 +76,6 @@ class Address extends \Faker\Provider\Address protected static $addressFormats = array( "{{region}} {{regionSuffix}}, {{cityPrefix}} {{city}}, {{street}} {{buildingNumber}} {{streetPrefix}}, {{postcode}}", - "{{postcode}}, {{region}} {{regionSuffix}}, {{cityPrefix}} {{city}}, {{street}} {{streetSuffix}}, {{buildingNumber}}", ); public static function buildingNumber() From 5eaec69fcd2ff28ece033e83e3ac27166e8d304f Mon Sep 17 00:00:00 2001 From: Hamlet Date: Sat, 22 Dec 2012 18:41:14 +0400 Subject: [PATCH 5/5] Fixed error --- src/Faker/Provider/hy_AM/Address.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Faker/Provider/hy_AM/Address.php b/src/Faker/Provider/hy_AM/Address.php index 1fe8e71f98..0c1bd271bf 100644 --- a/src/Faker/Provider/hy_AM/Address.php +++ b/src/Faker/Provider/hy_AM/Address.php @@ -114,12 +114,12 @@ public static function cityPrefix() return static::randomElement(static::$cityPrefix); } - public static function city() + public function city() { return static::randomElement(static::$city); } - public static function streetPrefix() + public function streetPrefix() { return static::randomElement(static::$streetPrefix); }