Skip to content
This repository was archived by the owner on Dec 11, 2020. It is now read-only.

Commit 4d9244b

Browse files
committed
Merge pull request #398 from DIOHz0r/master
Added es_VE provider (Venezuela)
2 parents 1ce76e8 + 98ff042 commit 4d9244b

File tree

6 files changed

+431
-75
lines changed

6 files changed

+431
-75
lines changed

src/Faker/Provider/Miscellaneous.php

+75-75
Original file line numberDiff line numberDiff line change
@@ -71,86 +71,86 @@ class Miscellaneous extends \Faker\Provider\Base
7171
);
7272

7373
protected static $localeData = array(
74-
'aa_DJ', 'aa_ER', 'aa_ET',
75-
'af_NA', 'af_ZA', 'ak_GH',
76-
'am_ET', 'ar_AE', 'ar_BH', 'ar_DZ',
77-
'ar_EG', 'ar_IQ', 'ar_JO', 'ar_KW', 'ar_LB',
78-
'ar_LY', 'ar_MA', 'ar_OM', 'ar_QA', 'ar_SA',
79-
'ar_SD', 'ar_SY', 'ar_TN', 'ar_YE',
80-
'as_IN', 'az_AZ', 'be_BY',
81-
'bg_BG', 'bn_BD', 'bn_IN',
82-
'bo_CN', 'bo_IN', 'bs_BA',
74+
'aa_DJ', 'aa_ER', 'aa_ET',
75+
'af_NA', 'af_ZA', 'ak_GH',
76+
'am_ET', 'ar_AE', 'ar_BH', 'ar_DZ',
77+
'ar_EG', 'ar_IQ', 'ar_JO', 'ar_KW', 'ar_LB',
78+
'ar_LY', 'ar_MA', 'ar_OM', 'ar_QA', 'ar_SA',
79+
'ar_SD', 'ar_SY', 'ar_TN', 'ar_YE',
80+
'as_IN', 'az_AZ', 'be_BY',
81+
'bg_BG', 'bn_BD', 'bn_IN',
82+
'bo_CN', 'bo_IN', 'bs_BA',
8383
'byn_ER', 'ca_ES',
8484
'cch_NG', 'cs_CZ',
85-
'cy_GB', 'da_DK', 'de_AT',
86-
'de_BE', 'de_CH', 'de_DE', 'de_LI', 'de_LU',
87-
'dv_MV', 'dz_BT',
88-
'ee_GH', 'ee_TG', 'el_CY', 'el_GR',
89-
'en_AS', 'en_AU', 'en_BE', 'en_BW',
90-
'en_BZ', 'en_CA', 'en_GB', 'en_GU', 'en_HK',
91-
'en_IE', 'en_IN', 'en_JM', 'en_MH', 'en_MP',
92-
'en_MT', 'en_NA', 'en_NZ', 'en_PH', 'en_PK',
93-
'en_SG', 'en_TT', 'en_UM', 'en_US', 'en_VI',
94-
'en_ZA', 'en_ZW', 'es_AR',
95-
'es_BO', 'es_CL', 'es_CO', 'es_CR', 'es_DO',
96-
'es_EC', 'es_ES', 'es_GT', 'es_HN', 'es_MX',
97-
'es_NI', 'es_PA', 'es_PE', 'es_PR', 'es_PY',
98-
'es_SV', 'es_US', 'es_UY', 'es_VE',
99-
'et_EE', 'eu_ES', 'fa_AF',
100-
'fa_IR', 'fi_FI', 'fil_PH',
101-
'fo_FO', 'fr_BE', 'fr_CA',
102-
'fr_CH', 'fr_FR', 'fr_LU', 'fr_MC', 'fr_SN',
85+
'cy_GB', 'da_DK', 'de_AT',
86+
'de_BE', 'de_CH', 'de_DE', 'de_LI', 'de_LU',
87+
'dv_MV', 'dz_BT',
88+
'ee_GH', 'ee_TG', 'el_CY', 'el_GR',
89+
'en_AS', 'en_AU', 'en_BE', 'en_BW',
90+
'en_BZ', 'en_CA', 'en_GB', 'en_GU', 'en_HK',
91+
'en_IE', 'en_IN', 'en_JM', 'en_MH', 'en_MP',
92+
'en_MT', 'en_NA', 'en_NZ', 'en_PH', 'en_PK',
93+
'en_SG', 'en_TT', 'en_UM', 'en_US', 'en_VI',
94+
'en_ZA', 'en_ZW', 'es_AR',
95+
'es_BO', 'es_CL', 'es_CO', 'es_CR', 'es_DO',
96+
'es_EC', 'es_ES', 'es_GT', 'es_HN', 'es_MX',
97+
'es_NI', 'es_PA', 'es_PE', 'es_PR', 'es_PY',
98+
'es_SV', 'es_US', 'es_UY', 'es_VE',
99+
'et_EE', 'eu_ES', 'fa_AF',
100+
'fa_IR', 'fi_FI', 'fil_PH',
101+
'fo_FO', 'fr_BE', 'fr_CA',
102+
'fr_CH', 'fr_FR', 'fr_LU', 'fr_MC', 'fr_SN',
103103
'fur_IT', 'ga_IE',
104104
'gaa_GH', 'gez_ER', 'gez_ET',
105-
'gl_ES', 'gsw_CH', 'gu_IN',
106-
'gv_GB', 'ha_GH', 'ha_NE',
107-
'ha_NG', 'ha_SD', 'haw_US',
108-
'he_IL', 'hi_IN', 'hr_HR',
109-
'hu_HU', 'hy_AM',
110-
'id_ID', 'ig_NG',
111-
'ii_CN', 'is_IS',
112-
'it_CH', 'it_IT',
113-
'ja_JP', 'ka_GE', 'kaj_NG',
105+
'gl_ES', 'gsw_CH', 'gu_IN',
106+
'gv_GB', 'ha_GH', 'ha_NE',
107+
'ha_NG', 'ha_SD', 'haw_US',
108+
'he_IL', 'hi_IN', 'hr_HR',
109+
'hu_HU', 'hy_AM',
110+
'id_ID', 'ig_NG',
111+
'ii_CN', 'is_IS',
112+
'it_CH', 'it_IT',
113+
'ja_JP', 'ka_GE', 'kaj_NG',
114114
'kam_KE', 'kcg_NG',
115-
'kfo_CI', 'kk_KZ', 'kl_GL',
116-
'km_KH', 'kn_IN',
117-
'ko_KR', 'kok_IN', 'kpe_GN',
118-
'kpe_LR', 'ku_IQ', 'ku_IR', 'ku_SY',
119-
'ku_TR', 'kw_GB', 'ky_KG',
120-
'ln_CD', 'ln_CG', 'lo_LA',
121-
'lt_LT', 'lv_LV',
122-
'mk_MK', 'ml_IN', 'mn_CN',
123-
'mn_MN', 'mr_IN',
124-
'ms_BN', 'ms_MY', 'mt_MT',
125-
'my_MM', 'nb_NO', 'nds_DE',
126-
'ne_IN', 'ne_NP', 'nl_BE',
127-
'nl_NL', 'nn_NO',
128-
'nr_ZA', 'nso_ZA', 'ny_MW',
129-
'oc_FR', 'om_ET', 'om_KE',
130-
'or_IN', 'pa_IN', 'pa_PK',
131-
'pl_PL', 'ps_AF',
132-
'pt_BR', 'pt_PT', 'ro_MD', 'ro_RO',
133-
'ru_RU', 'ru_UA', 'rw_RW',
134-
'sa_IN', 'se_FI', 'se_NO',
135-
'sh_BA', 'sh_CS', 'sh_YU',
136-
'si_LK', 'sid_ET', 'sk_SK',
137-
'sl_SI', 'so_DJ', 'so_ET',
138-
'so_KE', 'so_SO', 'sq_AL',
139-
'sr_BA', 'sr_CS', 'sr_ME', 'sr_RS', 'sr_YU',
140-
'ss_SZ', 'ss_ZA', 'st_LS',
141-
'st_ZA', 'sv_FI', 'sv_SE',
142-
'sw_KE', 'sw_TZ', 'syr_SY',
143-
'ta_IN', 'te_IN', 'tg_TJ',
144-
'th_TH', 'ti_ER', 'ti_ET',
115+
'kfo_CI', 'kk_KZ', 'kl_GL',
116+
'km_KH', 'kn_IN',
117+
'ko_KR', 'kok_IN', 'kpe_GN',
118+
'kpe_LR', 'ku_IQ', 'ku_IR', 'ku_SY',
119+
'ku_TR', 'kw_GB', 'ky_KG',
120+
'ln_CD', 'ln_CG', 'lo_LA',
121+
'lt_LT', 'lv_LV',
122+
'mk_MK', 'ml_IN', 'mn_CN',
123+
'mn_MN', 'mr_IN',
124+
'ms_BN', 'ms_MY', 'mt_MT',
125+
'my_MM', 'nb_NO', 'nds_DE',
126+
'ne_IN', 'ne_NP', 'nl_BE',
127+
'nl_NL', 'nn_NO',
128+
'nr_ZA', 'nso_ZA', 'ny_MW',
129+
'oc_FR', 'om_ET', 'om_KE',
130+
'or_IN', 'pa_IN', 'pa_PK',
131+
'pl_PL', 'ps_AF',
132+
'pt_BR', 'pt_PT', 'ro_MD', 'ro_RO',
133+
'ru_RU', 'ru_UA', 'rw_RW',
134+
'sa_IN', 'se_FI', 'se_NO',
135+
'sh_BA', 'sh_CS', 'sh_YU',
136+
'si_LK', 'sid_ET', 'sk_SK',
137+
'sl_SI', 'so_DJ', 'so_ET',
138+
'so_KE', 'so_SO', 'sq_AL',
139+
'sr_BA', 'sr_CS', 'sr_ME', 'sr_RS', 'sr_YU',
140+
'ss_SZ', 'ss_ZA', 'st_LS',
141+
'st_ZA', 'sv_FI', 'sv_SE',
142+
'sw_KE', 'sw_TZ', 'syr_SY',
143+
'ta_IN', 'te_IN', 'tg_TJ',
144+
'th_TH', 'ti_ER', 'ti_ET',
145145
'tig_ER', 'tn_ZA',
146-
'to_TO', 'tr_TR',
147-
'trv_TW', 'ts_ZA', 'tt_RU',
148-
'ug_CN', 'uk_UA',
149-
'ur_IN', 'ur_PK', 'uz_AF', 'uz_UZ',
150-
've_ZA', 'vi_VN',
151-
'wal_ET', 'wo_SN', 'xh_ZA',
152-
'yo_NG', 'zh_CN', 'zh_HK',
153-
'zh_MO', 'zh_SG', 'zh_TW', 'zu_ZA',
146+
'to_TO', 'tr_TR',
147+
'trv_TW', 'ts_ZA', 'tt_RU',
148+
'ug_CN', 'uk_UA',
149+
'ur_IN', 'ur_PK', 'uz_AF', 'uz_UZ',
150+
've_ZA', 'vi_VN',
151+
'wal_ET', 'wo_SN', 'xh_ZA',
152+
'yo_NG', 'zh_CN', 'zh_HK',
153+
'zh_MO', 'zh_SG', 'zh_TW', 'zu_ZA',
154154
);
155155

156156
/**
@@ -161,7 +161,7 @@ class Miscellaneous extends \Faker\Provider\Base
161161
*/
162162
public static function boolean($chanceOfGettingTrue = 50)
163163
{
164-
return mt_rand(1, 100) <= $chanceOfGettingTrue ? true: false;
164+
return mt_rand(1, 100) <= $chanceOfGettingTrue ? true : false;
165165
}
166166

167167
/**

src/Faker/Provider/es_VE/Address.php

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?php
2+
3+
namespace Faker\Provider\es_VE;
4+
5+
class Address extends \Faker\Provider\Address
6+
{
7+
protected static $cityPrefix = array('San', 'Santa', 'Puerto', 'Valle', 'Villa', 'Parroquia', 'El', 'Los', 'La', 'Las');
8+
protected static $citySuffix = array('del Valle', 'de Mara', 'de Altagracia', 'de Asis', 'del Tuy', 'de Mata');
9+
protected static $buildingNumber = array('###', '##', '#');
10+
protected static $streetPrefix = array(
11+
'Calle', 'Avenida', 'Av.', 'Cl.', 'Carretera', 'Callejón', 'Vereda'
12+
);
13+
protected static $streetSuffix = array('Norte', 'Este', ' Sur', ' Oeste');
14+
protected static $postcode = array('####');
15+
protected static $state = array(
16+
'Amazonas', 'Anzoátegui', 'Apure', 'Aragua', 'Barinas', 'Bolívar', 'Carabobo', 'Cojedes', 'Delta Amacuro',
17+
'Distrito Capital', 'Falcón', 'Guárico', 'Lara', 'Mérida', 'Miranda', 'Monagas', 'Nueva Esparta', 'Portuguesa',
18+
'Sucre', 'Táchira', 'Trujillo', 'Vargas', 'Yaracuy', 'Zulia'
19+
);
20+
protected static $country = array(
21+
'Afganistán', 'Albania', 'Alemania', 'Andorra', 'Angola', 'Antigua y Barbuda', 'Arabia Saudí', 'Argelia', 'Argentina', 'Armenia', 'Australia', 'Austria', 'Azerbaiyán',
22+
'Bahamas', 'Bangladés', 'Barbados', 'Baréin', 'Belice', 'Benín', 'Bielorrusia', 'Birmania', 'Bolivia', 'Bosnia-Herzegovina', 'Botsuana', 'Brasil', 'Brunéi Darusalam', 'Bulgaria', 'Burkina Faso', 'Burundi', 'Bután', 'Bélgica',
23+
'Cabo Verde', 'Camboya', 'Camerún', 'Canadá', 'Catar', 'Chad', 'Chile', 'China', 'Chipre', 'Ciudad del Vaticano', 'Colombia', 'Comoras', 'Congo', 'Corea del Norte', 'Corea del Sur', 'Costa Rica', 'Costa de Marfil', 'Croacia', 'Cuba',
24+
'Dinamarca', 'Dominica',
25+
'Ecuador', 'Egipto', 'El Salvador', 'Emiratos Árabes Unidos', 'Eritrea', 'Eslovaquia', 'Eslovenia', 'España', 'Estados Unidos de América', 'Estonia', 'Etiopía',
26+
'Filipinas', 'Finlandia', 'Fiyi', 'Francia',
27+
'Gabón', 'Gambia', 'Georgia', 'Ghana', 'Granada', 'Grecia', 'Guatemala', 'Guinea', 'Guinea Ecuatorial', 'Guinea-Bisáu', 'Guyana',
28+
'Haití', 'Honduras', 'Hungría',
29+
'India', 'Indonesia', 'Irak', 'Irlanda', 'Irán', 'Islandia', 'Islas Marshall', 'Islas Salomón', 'Israel', 'Italia',
30+
'Jamaica', 'Japón', 'Jordania',
31+
'Kazajistán', 'Kenia', 'Kirguistán', 'Kiribati', 'Kuwait',
32+
'Laos', 'Lesoto', 'Letonia', 'Liberia', 'Libia', 'Liechtenstein', 'Lituania', 'Luxemburgo', 'Líbano',
33+
'Macedonia', 'Madagascar', 'Malasia', 'Malaui', 'Maldivas', 'Mali', 'Malta', 'Marruecos', 'Mauricio', 'Mauritania', 'Micronesia', 'Moldavia', 'Mongolia', 'Montenegro', 'Mozambique', 'México', 'Mónaco',
34+
'Namibia', 'Nauru', 'Nepal', 'Nicaragua', 'Nigeria', 'Noruega', 'Nueva Zelanda', 'Níger',
35+
'Omán',
36+
'Pakistán', 'Palaos', 'Panamá', 'Papúa Nueva Guinea', 'Paraguay', 'Países Bajos', 'Perú', 'Polonia', 'Portugal',
37+
'Reino Unido', 'Reino Unido de Gran Bretaña e Irlanda del Norte', 'República Centroafricana', 'República Checa', 'República Democrática del Congo', 'República Dominicana', 'Ruanda', 'Rumanía', 'Rusia',
38+
'Samoa', 'San Cristóbal y Nieves', 'San Marino', 'San Vicente y las Granadinas', 'Santa Lucía', 'Santo Tomé y Príncipe', 'Senegal', 'Serbia', 'Seychelles', 'Sierra Leona', 'Singapur', 'Siria', 'Somalia', 'Sri Lanka', 'Suazilandia', 'Sudáfrica', 'Sudán', 'Suecia', 'Suiza', 'Surinam',
39+
'Tailandia', 'Tanzania', 'Tayikistán', 'Timor Oriental', 'Togo', 'Tonga', 'Trinidad y Tobago', 'Turkmenistán', 'Turquía', 'Tuvalu', 'Túnez',
40+
'Ucrania', 'Uganda', 'Uruguay', 'Uzbekistán',
41+
'Vanuatu', 'Venezuela', 'Vietnam',
42+
'Yemen', 'Yibuti',
43+
'Zambia', 'Zimbabue'
44+
);
45+
protected static $cityFormats = array(
46+
'{{cityPrefix}} {{firstName}}{{citySuffix}}',
47+
'{{cityPrefix}} {{firstName}}',
48+
'{{firstName}} {{citySuffix}}',
49+
'{{lastName}} {{citySuffix}}',
50+
);
51+
protected static $streetNameFormats = array(
52+
'{{streetPrefix}} {{firstName}}',
53+
'{{streetPrefix}} {{lastName}}',
54+
'{{streetPrefix}} {{firstName}} {{lastName}}'
55+
);
56+
protected static $streetAddressFormats = array(
57+
'{{streetName}}, {{buildingNumber}}, {{secondaryAddress}}',
58+
'{{streetName}}, {{secondaryAddress}}',
59+
);
60+
protected static $addressFormats = array(
61+
"{{streetAddress}}, {{city}} Edo. {{state}}",
62+
"{{streetAddress}}, {{city}} Edo. {{state}}, {{postcode}}"
63+
);
64+
protected static $secondaryAddressFormats = array('Nro #', 'Piso #', 'Casa #', 'Hab. #', 'Apto #', 'Nro ##', 'Piso ##', 'Casa ##', 'Hab. ##', 'Apto ##');
65+
66+
/**
67+
* @example 'Avenida'
68+
*/
69+
public static function streetPrefix()
70+
{
71+
return static::randomElement(static::$streetPrefix);
72+
}
73+
74+
/**
75+
* @example 'Villa'
76+
*/
77+
public static function cityPrefix()
78+
{
79+
return static::randomElement(static::$cityPrefix);
80+
}
81+
82+
/**
83+
* @example 'Nro 3'
84+
*/
85+
public static function secondaryAddress()
86+
{
87+
return static::numerify(static::randomElement(static::$secondaryAddressFormats));
88+
}
89+
90+
/**
91+
* @example 'Aragua'
92+
*/
93+
public static function state()
94+
{
95+
return static::randomElement(static::$state);
96+
}
97+
}

src/Faker/Provider/es_VE/Company.php

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace Faker\Provider\es_VE;
4+
5+
class Company extends \Faker\Provider\Company
6+
{
7+
protected static $formats = array(
8+
'{{companyPrefix}} {{lastName}} {{companySuffix}}',
9+
'{{companyPrefix}} {{lastName}}',
10+
'{{companyPrefix}} {{lastName}} y {{lastName}}',
11+
'{{lastName}} y {{lastName}} {{companySuffix}}',
12+
'{{lastName}} de {{lastName}} {{companySuffix}}',
13+
'{{lastName}} y {{lastName}}',
14+
'{{lastName}} de {{lastName}}'
15+
);
16+
17+
protected static $companyPrefix = array(
18+
'Asociación', 'Centro', 'Corporación', 'Cooperativa', 'Empresa', 'Gestora', 'Global', 'Grupo', 'Viajes',
19+
'Inversiones', 'Lic.', 'Dr.'
20+
);
21+
protected static $companySuffix = array('S.R.L.', 'C.A.', 'S.A.', 'R.L.', 'etc');
22+
23+
/**
24+
* @example 'Grupo'
25+
*/
26+
public static function companyPrefix()
27+
{
28+
return static::randomElement(static::$companyPrefix);
29+
}
30+
}

src/Faker/Provider/es_VE/Internet.php

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace Faker\Provider\es_VE;
4+
5+
class Internet extends \Faker\Provider\Internet
6+
{
7+
protected static $freeEmailDomain = array('gmail.com', 'hotmail.com', 'hotmail.es', 'yahoo.com', 'yahoo.es', 'live.com', 'hispavista.com', 'latinmail.com', 'terra.com');
8+
protected static $tld = array('com', 'com.ve', 'net', 'net.ve', 'org', 'org.ve', 'info.ve', 'co.ve', 'web.ve');
9+
10+
/**
11+
* Converts Spanish characters to their ASCII representation using an standard
12+
* chars convert function
13+
* @param $string
14+
* @return string
15+
*/
16+
private static function toAscii($string)
17+
{
18+
$from = array('á', 'Á', 'é', 'É', 'í', 'Í', 'ó', 'Ó', 'ú', 'Ú', 'ü', 'Ü', 'ñ', 'Ñ');
19+
$to = array('a', 'A', 'e', 'E', 'i', 'I', 'o', 'O', 'u', 'U', 'u', 'U', 'n', 'N');
20+
21+
return str_replace($from, $to, $string);
22+
}
23+
24+
/**
25+
* @example 'alex.iglesias'
26+
*/
27+
public function userName()
28+
{
29+
$format = static::randomElement(static::$userNameFormats);
30+
31+
return static::toLower(static::toAscii(static::bothify($this->generator->parse($format))));
32+
}
33+
34+
/**
35+
* @example 'lovato-exposito'
36+
*/
37+
public function domainWord()
38+
{
39+
list($company) = explode(' ', $this->generator->format('company'));
40+
41+
return static::toLower(static::toAscii(preg_replace('/\W/u', '', $company)));
42+
}
43+
}

0 commit comments

Comments
 (0)