1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-01-17 14:18:29 +01:00

first commit

This commit is contained in:
Francois Zaninotto 2011-10-15 00:49:26 +02:00
commit 1de1d8a39f
9 changed files with 1067 additions and 0 deletions

250
readme.md Normal file
View File

@ -0,0 +1,250 @@
# Faker
Faker is a PHP library that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you.
Faker is heavily inspired by Perl's [Data::Faker](http://search.cpan.org/~jasonk/Data-Faker-0.07/), and by ruby's [Faker](http://faker.rubyforge.org/).
Faker requires PHP >= 5.3.
## Usage
Faker offers a `Generator` object for all data generation. Prior to using a generator, you must add providers to it, to give the generator the ability to generate certain types of data. Here is the usual setup:
```php
<?php
$generator = new Faker\Generator();
$generator->addProvider(new Faker\Provider\Name($generator));
$generator->addProvider(new Faker\Provider\Address($generator));
$generator->addProvider(new Faker\Provider\PhoneNumber($generator));
$generator->addProvider(new Faker\Provider\Company($generator));
$generator->addProvider(new Faker\Provider\Lorem($generator));
```
Once it's initialized, a `Generator` object generates data by calling the type of data you want as a property.
```php
<?php
echo $generator->name;
// 'Lucy Cechtelar';
echo $generator->address;
// "426 Jordy Lodge
// Cartwrightshire, SC 88120-6700"
echo $generator->lorem;
// Sint velit eveniet. Rerum atque repellat voluptatem quia rerum. Numquam excepturi beatae sint laudantium consequatur. Magni occaecati itaque sint et sit tempore. Nesciunt amet quidem. Iusto deleniti cum autem ad quia aperiam.
// A consectetur quos aliquam. In iste aliquid et aut similique suscipit. Consequatur qui quaerat iste minus hic expedita. Consequuntur error magni et laboriosam. Aut aspernatur voluptatem sit aliquam. Dolores voluptatum est.
// Aut molestias et maxime. Fugit autem facilis quos vero. Eius quibusdam possimus est.
Ea quaerat et quisquam. Deleniti sunt quam. Adipisci consequatur id in occaecati. Et sint et. Ut ducimus quod nemo ab voluptatum.
```
## Providers
Bundled providers offer many data types:
* Address
* Company
* Lorem
* Name
* PhoneNumber
## Real Life Usage
The following script generates a valid XML document:
```php
<?xml version="1.0" encoding="UTF-8"?>
<contacts>
<?php for ($i=0; $i < 10; $i++): ?>
<contact firstName="<?php echo $generator->firstName ?>" lastName="<?php echo $generator->lastName ?>">
<phone number="<?php echo $generator->phoneNumber ?>"/>
<?php if (mt_rand(0,5) == 0): ?>
<countryOfBirth><?php echo $generator->country ?></countryOfBirth>
<?php endif; ?>
<address>
<street><?php echo $generator->streetAddress ?></street>
<city><?php echo $generator->city ?></city>
<postcode><?php echo $generator->postcode ?></postcode>
<state><?php echo $generator->state ?></state>
</address>
<company name="<?php echo $generator->company ?>" catchPhrase="<?php echo $generator->catchPhrase ?>">
<?php if (mt_rand(0,2) == 0): ?>
<offer><?php echo $generator->bs ?></offer>
<?php endif; ?>
<?php if (mt_rand(0,3) == 0): ?>
<director name="<?php echo $generator->name ?>"/>
<?php endif; ?>
</company>
<?php if (mt_rand(0,5) == 0): ?>
<details>
<![CDATA[<?php echo $generator->lorem(3) ?>]]>
</details>
<?php endif; ?>
</contact>
<?php endfor; ?>
</contacts>
```
When you run this script, you end up with a document looking like:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<contacts>
<contact firstName="Rosario" lastName="Collier">
<phone number="(931)716-3327x645"/>
<address>
<street>09678 Douglas Throughway</street>
<city>Cronaville</city>
<postcode>97573-1273</postcode>
<state>Wisconsin</state>
</address>
<company name="Rowe-Crist" catchPhrase="Persevering disintermediate support">
<offer>enhance scalable vortals</offer>
<director name="Lucy Bechtelar"/>
</company>
<details>
<![CDATA[Ea libero quia ratione. Architecto reiciendis et. Qui provident natus quo ut inventore. Voluptas quisquam deleniti. Sed ut voluptas.
Distinctio quo pariatur at natus vel. Ut deleniti eos voluptatem ut voluptas. Odit sint est temporibus et. Accusamus quam qui ad. Qui dolorem et earum. Rerum qui cupiditate iusto.
Autem quis suscipit molestias cumque incidunt. Porro omnis autem. Odit quia ipsum et iste. Iure veniam qui.
Assumenda numquam et itaque beatae ut ullam. Itaque totam dolor error ducimus facilis. Consequatur adipisci cum voluptate optio vel velit. Optio velit repellat magnam suscipit. Commodi repellat vel et quaerat. Amet ut corrupti tenetur voluptates dignissimos quo.
Debitis nostrum sunt sit porro maiores voluptates. Expedita perspiciatis est labore ex ipsam sint. Consequatur ipsa consequatur. Adipisci voluptatibus voluptate dolorem consequatur ducimus. Delectus suscipit explicabo ea nostrum.
Rerum sunt eos. Sed exercitationem iure consequatur doloribus. Itaque ratione error porro omnis dolorem. Accusantium sed sint iste fugit quidem veniam. Molestiae facilis consequatur. Optio ducimus eum rerum maxime.]]>
</details>
</contact>
<contact firstName="Korey" lastName="Donnelly">
<phone number="028-470-4927"/>
<address>
<street>413 Harber Street Apt. 536</street>
<city>Port Kaleighport</city>
<postcode>16436</postcode>
<state>Oregon</state>
</address>
<company name="Bradtke, Klein and Kiehn" catchPhrase="Pre-emptive directional throughput">
</company>
</contact>
<contact firstName="Jettie" lastName="Rutherford">
<phone number="175-227-9402x7968"/>
<address>
<street>034 Pollich Fords Suite 763</street>
<city>Port Cloydberg</city>
<postcode>95235</postcode>
<state>NewHampshire</state>
</address>
<company name="Mohr, Koelpin and Stroman" catchPhrase="User-centric demand-driven migration">
</company>
</contact>
<contact firstName="Ambrose" lastName="Willms">
<phone number="(992)690-3531x30946"/>
<placeOfBirth>Pitcairn Islands</placeOfBirth>
<address>
<street>70028 Wisoky Wall</street>
<city>Tremblayberg</city>
<postcode>59624-3945</postcode>
<state>Ohio</state>
</address>
<company name="Farrell, Leffler and Paucek" catchPhrase="Enhanced global strategy">
<offer>unleash front-end deliverables</offer>
<director name="Fletcher Lind"/>
</company>
<details>
<![CDATA[Nesciunt accusantium qui voluptatum. Eum alias sequi a. Ut iusto quos. Molestiae explicabo quam ut reiciendis veritatis velit. Dolor incidunt quaerat.
Molestias harum quidem. Animi velit aut qui. Sunt qui culpa explicabo id id rerum. Consequatur omnis porro.
Numquam nisi maiores eveniet. Sint aut praesentium et fugiat necessitatibus. Esse excepturi non excepturi eaque id illo. Voluptas ea rerum voluptates quidem minima. Dolorum vel odio itaque optio.
Nisi aliquid est autem aspernatur. Quasi eveniet et quas et accusamus. Non nostrum quo. Molestiae dolores aliquam dignissimos non ea ea. Magni molestiae nobis quasi voluptate expedita illum. Illo aperiam et saepe voluptatem vel.
Qui repellendus fuga corrupti perferendis. Magnam amet beatae repellendus. Architecto et et quam. Omnis explicabo maxime qui. Libero et est quasi. Omnis nisi eveniet eum repellendus ut.
Repellat sequi quidem eum quam. Rerum optio totam corporis aut libero necessitatibus. Quisquam nihil aut beatae tempore maxime.]]>
</details>
</contact>
<contact firstName="Clair" lastName="Schumm">
<phone number="+54(9)9521808817"/>
<address>
<street>5208 Celia Route Suite 082</street>
<city>Port Albin</city>
<postcode>91670-9099</postcode>
<state>Wisconsin</state>
</address>
<company name="Bins-Effertz" catchPhrase="Triple-buffered systematic initiative">
</company>
</contact>
<contact firstName="Orland" lastName="Collier">
<phone number="(788)806-3732"/>
<address>
<street>692 Nelda Branch</street>
<city>North Shaina</city>
<postcode>40220</postcode>
<state>Nebraska</state>
</address>
<company name="Schuster and Sons" catchPhrase="Triple-buffered background synergy">
<offer>exploit sexy models</offer>
<director name="Mary Carter PhD"/>
</company>
</contact>
<contact firstName="Jacinto" lastName="Kozey">
<phone number="271.710.1171x50715"/>
<address>
<street>620 Watsica Extension</street>
<city>Quigleybury</city>
<postcode>31688-4724</postcode>
<state>Alaska</state>
</address>
<company name="Kuphal-Casper" catchPhrase="Advanced well-modulated policy">
</company>
</contact>
<contact firstName="Filomena" lastName="Jacobs">
<phone number="(317)630-2597x835"/>
<address>
<street>026 Florian Lights Apt. 130</street>
<city>North Mireille</city>
<postcode>68929</postcode>
<state>Maryland</state>
</address>
<company name="Romaguera, Buckridge and Kutch" catchPhrase="Self-enabling systemic portal">
<offer>cultivate rich infomediaries</offer>
</company>
</contact>
<contact firstName="Ettie" lastName="McCullough">
<phone number="481-073-8855x07450"/>
<address>
<street>485 Imani Falls Suite 202</street>
<city>Marvinbury</city>
<postcode>12186-1993</postcode>
<state>WestVirginia</state>
</address>
<company name="Volkman-Hand" catchPhrase="User-friendly analyzing groupware">
<offer>streamline granular users</offer>
<director name="Bennie Stroman"/>
</company>
<details>
<![CDATA[Iure optio sint dolorum modi. Voluptas est numquam non et. Et ducimus atque ipsam. Rerum cupiditate enim accusantium. Sint adipisci nobis quasi qui. Sed vitae et quaerat illo omnis et.
Illum praesentium non praesentium eum. Occaecati ex voluptatem eos ut velit sunt. Ut quia optio qui.
Temporibus omnis ullam autem voluptatem. Quae est nulla impedit ratione. Quasi quo quo et. Aspernatur delectus aliquid nostrum distinctio perspiciatis autem.
Est voluptate explicabo voluptatibus officia aut sequi. Eveniet vero voluptas quo quaerat. Nihil voluptas exercitationem qui rerum. Magni et aut amet iste. Eum quia et quia quos. Commodi commodi temporibus voluptas.]]>
</details>
</contact>
<contact firstName="Petra" lastName="Lebsack">
<phone number="1-065-470-3688x528"/>
<placeOfBirth>Italy</placeOfBirth>
<address>
<street>36949 Weissnat Cape</street>
<city>Swiftfort</city>
<postcode>80494</postcode>
<state>WestVirginia</state>
</address>
<company name="Nienow LLC" catchPhrase="Balanced grid-enabled task-force">
</company>
</contact>
</contacts>
```
## License
Faker is released under the MIT Licence.
Copyright (c) 2011 François Zaninotto
Portions Copyright (c) 2008 Caius Durling
Portions Copyright (c) 2008 Adam Royle
Portions Copyright (c) 2008 Fiona Burrows
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

127
src/Generator.php Normal file
View File

@ -0,0 +1,127 @@
<?php
namespace Faker;
class Generator
{
protected $providers = array();
protected $formatters = array();
public function addProvider($providers)
{
$this->providers[]= $providers;
}
public function format($formatter, $arguments = array())
{
return call_user_func_array($this->getFormatter($formatter), $arguments);
}
/**
* @return Callable
*/
public function getFormatter($formatter)
{
if (isset($this->formatters[$formatter])) {
return $this->formatters[$formatter];
}
foreach ($this->providers as $provider) {
if (method_exists($provider, $formatter)) {
$this->formatters[$formatter] = array($provider, $formatter);
return $this->formatters[$formatter];
}
}
throw new \InvalidArgumentException(sprintf('Unknown formatter "%s"', $formatter));
}
/**
* Returns a random number between 0 and 9
*
* @return integer
*/
public static function randomDigit()
{
return mt_rand(0, 9);
}
/**
* Returns a random letter from a to z
*
* @return string
*/
public static function randomLetter()
{
return chr(mt_rand(97, 122));
}
/**
* Returns a random element from a passed array
*
* @param array $array
* @return mixed
*/
public static function randomElement($array)
{
return $array[array_rand($array)];
}
/**
* Replaces all hash sign ('#') occurrences with a random number
*
* @param string $string String that needs to bet parsed
* @return string
*/
public static function numerify($string)
{
return preg_replace_callback('/\#/', get_called_class() . '::randomDigit', $string);
}
/**
* Replaces all question mark ('?') occurrences with a random letter
*
* @param string $string String that needs to bet parsed
* @return string
*/
public static function lexify($string)
{
return preg_replace_callback('/\?/', get_called_class() . '::randomLetter', $string);
}
/**
* Replaces hash signs and question marks with random numbers and letters
*
* @param string $string String that needs to bet parsed
* @return string
*/
public static function bothify($string)
{
return self::lexify(self::numerify($string));
}
/**
* Replaces tokens ('{{ tokenName }}') with the result from the token method call
*
* @param string $string String that needs to bet parsed
* @return string
*/
public function parse($string)
{
return preg_replace_callback('/\{\{\s?(\w+)\s?\}\}/', array($this, 'callFormatWithMatches'), $string);
}
protected function callFormatWithMatches($matches)
{
return $this->format($matches[1]);
}
public function __get($attribute)
{
return $this->format($attribute);
}
public function __call($method, $attributes)
{
return $this->format($method, $attributes);
}
}

145
src/Provider/Address.php Normal file
View File

@ -0,0 +1,145 @@
<?php
namespace Faker\Provider;
class 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 $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'
);
protected static $secondaryAddress = array('Apt. ###', 'Suite ###');
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 $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',
'Cambodia','Cameroon','Canada','Cape Verde','Cayman Islands','Central African Republic','Chad','Chile','China','Christmas Island','Cocos (Keeling) Islands','Colombia','Comoros','Congo','Congo','Cook Islands','Costa Rica','Cote d\'Ivoire','Croatia','Cuba','Cyprus','Czech Republic',
'Denmark','Djibouti','Dominica','Dominican Republic',
'Ecuador','Egypt','El Salvador','Equatorial Guinea','Eritrea','Estonia','Ethiopia',
'Faroe Islands','Falkland Islands (Malvinas)','Fiji','Finland','France','French Guiana','French Polynesia','French Southern Territories',
'Gabon','Gambia','Georgia','Germany','Ghana','Gibraltar','Greece','Greenland','Grenada','Guadeloupe','Guam','Guatemala','Guernsey','Guinea','Guinea-Bissau','Guyana',
'Haiti','Heard Island and McDonald Islands','Holy See (Vatican City State)','Honduras','Hong Kong','Hungary',
'Iceland','India','Indonesia','Iran','Iraq','Ireland','Isle of Man','Israel','Italy',
'Jamaica','Japan','Jersey','Jordan',
'Kazakhstan','Kenya','Kiribati','Korea','Korea','Kuwait','Kyrgyz Republic',
'Lao People\'s Democratic Republic','Latvia','Lebanon','Lesotho','Liberia','Libyan Arab Jamahiriya','Liechtenstein','Lithuania','Luxembourg',
'Macao','Macedonia','Madagascar','Malawi','Malaysia','Maldives','Mali','Malta','Marshall Islands','Martinique','Mauritania','Mauritius','Mayotte','Mexico','Micronesia','Moldova','Monaco','Mongolia','Montenegro','Montserrat','Morocco','Mozambique','Myanmar',
'Namibia','Nauru','Nepal','Netherlands Antilles','Netherlands','New Caledonia','New Zealand','Nicaragua','Niger','Nigeria','Niue','Norfolk Island','Northern Mariana Islands','Norway',
'Oman',
'Pakistan','Palau','Palestinian Territory','Panama','Papua New Guinea','Paraguay','Peru','Philippines','Pitcairn Islands','Poland','Portugal','Puerto Rico',
'Qatar',
'Reunion','Romania','Russian Federation','Rwanda',
'Saint Barthelemy','Saint Helena','Saint Kitts and Nevis','Saint Lucia','Saint Martin','Saint Pierre and Miquelon','Saint Vincent and the Grenadines','Samoa','San Marino','Sao Tome and Principe','Saudi Arabia','Senegal','Serbia','Seychelles','Sierra Leone','Singapore','Slovakia (Slovak Republic)','Slovenia','Solomon Islands','Somalia','South Africa','South Georgia and the South Sandwich Islands','Spain','Sri Lanka','Sudan','Suriname','Svalbard & Jan Mayen Islands','Swaziland','Sweden','Switzerland','Syrian Arab Republic',
'Taiwan','Tajikistan','Tanzania','Thailand','Timor-Leste','Togo','Tokelau','Tonga','Trinidad and Tobago','Tunisia','Turkey','Turkmenistan','Turks and Caicos Islands','Tuvalu',
'Uganda','Ukraine','United Arab Emirates','United Kingdom','United States of America','United States Minor Outlying Islands','United States Virgin Islands','Uruguay','Uzbekistan',
'Vanuatu','Venezuela','Vietnam',
'Wallis and Futuna','Western Sahara',
'Yemen',
'Zambia','Zimbabwe'
);
protected static $cityFormats = array(
'{{cityPrefix}} {{firstName}}{{citySuffix}}',
'{{cityPrefix}} {{firstName}}',
'{{firstName}}{{citySuffix}}',
'{{lastName}}{{citySuffix}}',
);
protected static $streetNameFormats = array(
'{{firstName}} {{streetSuffix}}',
'{{lastName}} {{streetSuffix}}'
);
protected static $streetAddressFormats = array(
'{{buildingNumber}} {{streetName}}',
'{{buildingNumber}} {{streetName}} {{secondaryAddress}}',
);
protected static $addressFormats = array(
"{{streetAddress}}\n{{city}}, {{stateAbbr}} {{postcode}}",
);
protected $generator;
public function __construct($generator)
{
$this->generator = $generator;
}
public static function cityPrefix()
{
return self::$cityPrefix[array_rand(self::$cityPrefix)];
}
public static function citySuffix()
{
return self::$citySuffix[array_rand(self::$citySuffix)];
}
public function buildingNumber()
{
$format = self::$buildingNumber[array_rand(self::$buildingNumber)];
return $this->generator->numerify($format);
}
public static function streetSuffix()
{
return self::$streetSuffix[array_rand(self::$streetSuffix)];
}
public function city()
{
$format = self::$cityFormats[array_rand(self::$cityFormats)];
return $this->generator->parse($format);
}
public function streetName()
{
$format = self::$streetNameFormats[array_rand(self::$streetNameFormats)];
return $this->generator->parse($format);
}
public function streetAddress()
{
$format = self::$streetAddressFormats[array_rand(self::$streetAddressFormats)];
return $this->generator->numerify($this->generator->parse($format));
}
public function secondaryAddress()
{
$format = self::$secondaryAddress[array_rand(self::$secondaryAddress)];
return $this->generator->numerify($format);
}
public function postcode()
{
$format = self::$postcode[array_rand(self::$postcode)];
return $this->generator->numerify($format);
}
public static function state()
{
return self::$state[array_rand(self::$state)];
}
public static function stateAbbr()
{
return self::$stateAbbr[array_rand(self::$stateAbbr)];
}
public function address()
{
$format = self::$addressFormats[array_rand(self::$addressFormats)];
return $this->generator->parse($format);
}
public static function country()
{
return self::$country[array_rand(self::$country)];
}
}

76
src/Provider/Company.php Normal file
View File

@ -0,0 +1,76 @@
<?php
namespace Faker\Provider;
class Company
{
protected static $formats = array(
'{{lastName}} {{companySuffix}}',
'{{lastName}}-{{lastName}}',
'{{lastName}}, {{lastName}} and {{lastName}}'
);
protected static $catchPhraseWords = array(
array(
'Adaptive','Advanced','Ameliorated','Assimilated','Automated','Balanced','Business-focused','Centralized','Cloned','Compatible','Configurable','Cross-group','Cross-platform','Customer-focused','Customizable','Decentralized','De-engineered','Devolved','Digitized','Distributed','Diverse','Down-sized','Enhanced','Enterprise-wide','Ergonomic','Exclusive','Expanded','Extended','Facetoface','Focused','Front-line','Fully-configurable','Function-based','Fundamental','Future-proofed','Grass-roots','Horizontal','Implemented','Innovative','Integrated','Intuitive','Inverse','Managed','Mandatory','Monitored','Multi-channelled','Multi-lateral','Multi-layered','Multi-tiered','Networked','Object-based','Open-architected','Open-source','Operative','Optimized','Optional','Organic','Organized','Persevering','Persistent','Phased','Polarised','Pre-emptive','Proactive','Profit-focused','Profound','Programmable','Progressive','Public-key','Quality-focused','Reactive','Realigned','Re-contextualized','Re-engineered','Reduced','Reverse-engineered','Right-sized','Robust','Seamless','Secured','Self-enabling','Sharable','Stand-alone','Streamlined','Switchable','Synchronised','Synergistic','Synergized','Team-oriented','Total','Triple-buffered','Universal','Up-sized','Upgradable','User-centric','User-friendly','Versatile','Virtual','Visionary','Vision-oriented'
),
array(
'24hour','24/7','3rdgeneration','4thgeneration','5thgeneration','6thgeneration','actuating','analyzing','assymetric','asynchronous','attitude-oriented','background','bandwidth-monitored','bi-directional','bifurcated','bottom-line','clear-thinking','client-driven','client-server','coherent','cohesive','composite','context-sensitive','contextually-based','content-based','dedicated','demand-driven','didactic','directional','discrete','disintermediate','dynamic','eco-centric','empowering','encompassing','even-keeled','executive','explicit','exuding','fault-tolerant','foreground','fresh-thinking','full-range','global','grid-enabled','heuristic','high-level','holistic','homogeneous','human-resource','hybrid','impactful','incremental','intangible','interactive','intermediate','leadingedge','local','logistical','maximized','methodical','mission-critical','mobile','modular','motivating','multimedia','multi-state','multi-tasking','national','needs-based','neutral','nextgeneration','non-volatile','object-oriented','optimal','optimizing','radical','real-time','reciprocal','regional','responsive','scalable','secondary','solution-oriented','stable','static','systematic','systemic','system-worthy','tangible','tertiary','transitional','uniform','upward-trending','user-facing','value-added','web-enabled','well-modulated','zeroadministration','zerodefect','zerotolerance'
),
array(
'ability','access','adapter','algorithm','alliance','analyzer','application','approach','architecture','archive','artificialintelligence','array','attitude','benchmark','budgetarymanagement','capability','capacity','challenge','circuit','collaboration','complexity','concept','conglomeration','contingency','core','customerloyalty','database','data-warehouse','definition','emulation','encoding','encryption','extranet','firmware','flexibility','focusgroup','forecast','frame','framework','function','functionalities','GraphicInterface','groupware','GraphicalUserInterface','hardware','help-desk','hierarchy','hub','implementation','info-mediaries','infrastructure','initiative','installation','instructionset','interface','internetsolution','intranet','knowledgeuser','knowledgebase','localareanetwork','leverage','matrices','matrix','methodology','middleware','migration','model','moderator','monitoring','moratorium','neural-net','openarchitecture','opensystem','orchestration','paradigm','parallelism','policy','portal','pricingstructure','processimprovement','product','productivity','project','projection','protocol','securedline','service-desk','software','solution','standardization','strategy','structure','success','superstructure','support','synergy','systemengine','task-force','throughput','time-frame','toolset','utilisation','website','workforce'
)
);
protected static $bsWords = array(
array(
'implement','utilize','integrate','streamline','optimize','evolve','transform','embrace','enable','orchestrate','leverage','reinvent','aggregate','architect','enhance','incentivize','morph','empower','envisioneer','monetize','harness','facilitate','seize','disintermediate','synergize','strategize','deploy','brand','grow','target','syndicate','synthesize','deliver','mesh','incubate','engage','maximize','benchmark','expedite','reintermediate','whiteboard','visualize','repurpose','innovate','scale','unleash','drive','extend','engineer','revolutionize','generate','exploit','transition','e-enable','iterate','cultivate','matrix','productize','redefine','recontextualize'
),
array(
'clicks-and-mortar','value-added','vertical','proactive','robust','revolutionary','scalable','leading-edge','innovative','intuitive','strategic','e-business','mission-critical','sticky','one-to-one','24/7','end-to-end','global','B2B','B2C','granular','frictionless','virtual','viral','dynamic','24/365','best-of-breed','killer','magnetic','bleeding-edge','web-enabled','interactive','dot-com','sexy','back-end','real-time','efficient','front-end','distributed','seamless','extensible','turn-key','world-class','open-source','cross-platform','cross-media','synergistic','bricks-and-clicks','out-of-the-box','enterprise','integrated','impactful','wireless','transparent','next-generation','cutting-edge','user-centric','visionary','customized','ubiquitous','plug-and-play','collaborative','compelling','holistic','rich'
),
array(
'synergies','web-readiness','paradigms','markets','partnerships','infrastructures','platforms','initiatives','channels','eyeballs','communities','ROI','solutions','e-tailers','e-services','action-items','portals','niches','technologies','content','vortals','supply-chains','convergence','relationships','architectures','interfaces','e-markets','e-commerce','systems','bandwidth','infomediaries','models','mindshare','deliverables','users','schemas','networks','applications','metrics','e-business','functionalities','experiences','webservices','methodologies'
)
);
protected static $companySuffix = array('Inc','and Sons','LLC','Group','PLC','Ltd');
protected $generator;
public function __construct($generator)
{
$this->generator = $generator;
}
public function company()
{
$format = self::$formats[array_rand(self::$formats)];
return $this->generator->parse($format);
}
public function companySuffix()
{
return self::$companySuffix[array_rand(self::$companySuffix)];;
}
public function catchPhrase()
{
$result = array();
foreach (self::$catchPhraseWords as &$word) {
$result[] = $this->generator->randomElement($word);
}
return join($result, ' ');
}
public function bs()
{
$result = array();
foreach (self::$bsWords as &$word) {
$result[] = $this->generator->randomElement($word);
}
return join($result, ' ');
}
}

96
src/Provider/Lorem.php Normal file
View File

@ -0,0 +1,96 @@
<?php
namespace Faker\Provider;
class Lorem
{
protected static $wordList = array(
'alias', 'consequatur', 'aut', 'perferendis', 'sit', 'voluptatem', 'accusantium', 'doloremque', 'aperiam', 'eaque', 'ipsa', 'quae', 'ab', 'illo', 'inventore', 'veritatis', 'et', 'quasi', 'architecto', 'beatae', 'vitae', 'dicta', 'sunt', 'explicabo', 'aspernatur', 'aut', 'odit', 'aut', 'fugit', 'sed', 'quia', 'consequuntur', 'magni', 'dolores', 'eos', 'qui', 'ratione', 'voluptatem', 'sequi', 'nesciunt', 'neque', 'dolorem', 'ipsum', 'quia', 'dolor', 'sit', 'amet', 'consectetur', 'adipisci', 'velit', 'sed', 'quia', 'non', 'numquam', 'eius', 'modi', 'tempora', 'incidunt', 'ut', 'labore', 'et', 'dolore', 'magnam', 'aliquam', 'quaerat', 'voluptatem', 'ut', 'enim', 'ad', 'minima', 'veniam', 'quis', 'nostrum', 'exercitationem', 'ullam', 'corporis', 'nemo', 'enim', 'ipsam', 'voluptatem', 'quia', 'voluptas', 'sit', 'suscipit', 'laboriosam', 'nisi', 'ut', 'aliquid', 'ex', 'ea', 'commodi', 'consequatur', 'quis', 'autem', 'vel', 'eum', 'iure', 'reprehenderit', 'qui', 'in', 'ea', 'voluptate', 'velit', 'esse', 'quam', 'nihil', 'molestiae', 'et', 'iusto', 'odio', 'dignissimos', 'ducimus', 'qui', 'blanditiis', 'praesentium', 'laudantium', 'totam', 'rem', 'voluptatum', 'deleniti', 'atque', 'corrupti', 'quos', 'dolores', 'et', 'quas', 'molestias', 'excepturi', 'sint', 'occaecati', 'cupiditate', 'non', 'provident', 'sed', 'ut', 'perspiciatis', 'unde', 'omnis', 'iste', 'natus', 'error', 'similique', 'sunt', 'in', 'culpa', 'qui', 'officia', 'deserunt', 'mollitia', 'animi', 'id', 'est', 'laborum', 'et', 'dolorum', 'fuga', 'et', 'harum', 'quidem', 'rerum', 'facilis', 'est', 'et', 'expedita', 'distinctio', 'nam', 'libero', 'tempore', 'cum', 'soluta', 'nobis', 'est', 'eligendi', 'optio', 'cumque', 'nihil', 'impedit', 'quo', 'porro', 'quisquam', 'est', 'qui', 'minus', 'id', 'quod', 'maxime', 'placeat', 'facere', 'possimus', 'omnis', 'voluptas', 'assumenda', 'est', 'omnis', 'dolor', 'repellendus', 'temporibus', 'autem', 'quibusdam', 'et', 'aut', 'consequatur', 'vel', 'illum', 'qui', 'dolorem', 'eum', 'fugiat', 'quo', 'voluptas', 'nulla', 'pariatur', 'at', 'vero', 'eos', 'et', 'accusamus', 'officiis', 'debitis', 'aut', 'rerum', 'necessitatibus', 'saepe', 'eveniet', 'ut', 'et', 'voluptates', 'repudiandae', 'sint', 'et', 'molestiae', 'non', 'recusandae', 'itaque', 'earum', 'rerum', 'hic', 'tenetur', 'a', 'sapiente', 'delectus', 'ut', 'aut', 'reiciendis', 'voluptatibus', 'maiores', 'doloribus', 'asperiores', 'repellat'
);
public static function word()
{
return self::$wordList[array_rand(self::$wordList)];
}
/**
* Generate an array of random words
*
* @param integer $nb how many words to return
* @return array
*/
public static function words($nb = 3)
{
$words = array();
for ($i=0; $i < $nb; $i++) {
$words []= self::word();
}
return $words;
}
/**
* Generate a random sentence
*
* @param integer $nbWords around how many words the sentence should contain
* @return string
*/
public function sentence($nbWords = 3)
{
$words = self::words($nbWords + mt_rand(0, 4));
$words[0] = ucwords($words[0]);
return join($words, ' ') . '.';
}
/**
* Generate an array of sentences
*
* @param integer $nb how many sentences to return
* @return array
*/
public function sentences($nb = 3)
{
$sentences = array();
for ($i=0; $i < $nb; $i++) {
$sentences []= self::sentence();
}
return $sentences;
}
/**
* Generate a single paragraph
*
* @param integer $nbSentences around how many sentences the paragraph should contain
* @return string
*/
public function paragraph($nbSentences = 3)
{
return join(self::sentences($nbSentences + mt_rand(0, 3)), ' ');
}
/**
* Generate an array of paragraphs
*
* @param integer $nb how many paragraphs to return
* @return array
*/
public function paragraphs($nb)
{
$paragraphs = array();
for ($i=0; $i < $nb; $i++) {
$paragraphs []= self::paragraph();
}
return $paragraphs;
}
/**
* Generate a long text string
*
* @param integer $nbParagraphs around how many paragraphs the text should contain
* @return string
*/
public function lorem($nbParagraphs = 3)
{
return join(self::paragraphs($nbParagraphs + mt_rand(0, 3)), "\n");
}
}

110
src/Provider/Name.php Normal file
View File

@ -0,0 +1,110 @@
<?php
namespace Faker\Provider;
class Name
{
protected static $formats = array(
'{{firstName}} {{lastName}}',
'{{firstName}} {{lastName}}',
'{{firstName}} {{lastName}}',
'{{firstName}} {{lastName}}',
'{{firstName}} {{lastName}}',
'{{prefix}} {{firstName}} {{lastName}}',
'{{firstName}} {{lastName}} {{suffix}}',
'{{prefix}} {{firstName}} {{lastName}} {{suffix}}'
);
protected static $firstName = array(
'Aaliyah','Aaron','Abagail','Abbey','Abbie','Abbigail','Abby','Abdiel','Abdul','Abdullah','Abe','Abel','Abelardo','Abigail','Abigale','Abigayle','Abner','Abraham','Ada','Adah','Adalberto','Adaline','Adam','Adan','Addie','Addison','Adela','Adelbert','Adele','Adelia','Adeline','Adell','Adella','Adelle','Aditya','Adolf','Adolfo','Adolph','Adolphus','Adonis','Adrain','Adrian','Adriana','Adrianna','Adriel','Adrien','Adrienne','Afton','Aglae','Agnes','Agustin','Agustina','Ahmad','Ahmed','Aida','Aidan','Aiden','Aileen','Aimee','Aisha','Aiyana','Akeem','Al','Alaina','Alan','Alana','Alanis','Alanna','Alayna','Alba','Albert','Alberta','Albertha','Alberto','Albin','Albina','Alda','Alden','Alec','Aleen','Alejandra','Alejandrin','Alek','Alena','Alene','Alessandra','Alessandro','Alessia','Aletha','Alex','Alexa','Alexander','Alexandra','Alexandre','Alexandrea','Alexandria','Alexandrine','Alexandro','Alexane','Alexanne','Alexie','Alexis','Alexys','Alexzander','Alf','Alfonso','Alfonzo','Alford','Alfred','Alfreda','Alfredo','Ali','Alia','Alice','Alicia','Alisa','Alisha','Alison','Alivia','Aliya','Aliyah','Aliza','Alize','Allan','Allen','Allene','Allie','Allison','Ally','Alphonso','Alta','Althea','Alva','Alvah','Alvena','Alvera','Alverta','Alvina','Alvis','Alyce','Alycia','Alysa','Alysha','Alyson','Alysson','Amalia','Amanda','Amani','Amara','Amari','Amaya','Amber','Ambrose','Amelia','Amelie','Amely','America','Americo','Amie','Amina','Amir','Amira','Amiya','Amos','Amparo','Amy','Amya','Ana','Anabel','Anabelle','Anahi','Anais','Anastacio','Anastasia','Anderson','Andre','Andreane','Andreanne','Andres','Andrew','Andy','Angel','Angela','Angelica','Angelina','Angeline','Angelita','Angelo','Angie','Angus','Anibal','Anika','Anissa','Anita','Aniya','Aniyah','Anjali','Anna','Annabel','Annabell','Annabelle','Annalise','Annamae','Annamarie','Anne','Annetta','Annette','Annie','Ansel','Ansley','Anthony','Antoinette','Antone','Antonetta','Antonette','Antonia','Antonietta','Antonina','Antonio','Antwan','Antwon','Anya','April','Ara','Araceli','Aracely','Arch','Archibald','Ardella','Arden','Ardith','Arely','Ari','Ariane','Arianna','Aric','Ariel','Arielle','Arjun','Arlene','Arlie','Arlo','Armand','Armando','Armani','Arnaldo','Arne','Arno','Arnold','Arnoldo','Arnulfo','Aron','Art','Arthur','Arturo','Arvel','Arvid','Arvilla','Aryanna','Asa','Asha','Ashlee','Ashleigh','Ashley','Ashly','Ashlynn','Ashton','Ashtyn','Asia','Assunta','Astrid','Athena','Aubree','Aubrey','Audie','Audra','Audreanne','Audrey','August','Augusta','Augustine','Augustus','Aurelia','Aurelie','Aurelio','Aurore','Austen','Austin','Austyn','Autumn','Ava','Avery','Avis','Axel','Ayana','Ayden','Ayla','Aylin',
'Baby','Bailee','Bailey','Barbara','Barney','Baron','Barrett','Barry','Bart','Bartholome','Barton','Baylee','Beatrice','Beau','Beaulah','Bell','Bella','Belle','Ben','Benedict','Benjamin','Bennett','Bennie','Benny','Benton','Berenice','Bernadette','Bernadine','Bernard','Bernardo','Berneice','Bernhard','Bernice','Bernie','Berniece','Bernita','Berry','Bert','Berta','Bertha','Bertram','Bertrand','Beryl','Bessie','Beth','Bethany','Bethel','Betsy','Bette','Bettie','Betty','Bettye','Beulah','Beverly','Bianka','Bill','Billie','Billy','Birdie','Blair','Blaise','Blake','Blanca','Blanche','Blaze','Bo','Bobbie','Bobby','Bonita','Bonnie','Boris','Boyd','Brad','Braden','Bradford','Bradley','Bradly','Brady','Braeden','Brain','Brandi','Brando','Brandon','Brandt','Brandy','Brandyn','Brannon','Branson','Brant','Braulio','Braxton','Brayan','Breana','Breanna','Breanne','Brenda','Brendan','Brenden','Brendon','Brenna','Brennan','Brennon','Brent','Bret','Brett','Bria','Brian','Briana','Brianne','Brice','Bridget','Bridgette','Bridie','Brielle','Brigitte','Brionna','Brisa','Britney','Brittany','Brock','Broderick','Brody','Brook','Brooke','Brooklyn','Brooks','Brown','Bruce','Bryana','Bryce','Brycen','Bryon','Buck','Bud','Buddy','Buford','Bulah','Burdette','Burley','Burnice','Buster',
'Cade','Caden','Caesar','Caitlyn','Cale','Caleb','Caleigh','Cali','Calista','Callie','Camden','Cameron','Camila','Camilla','Camille','Camren','Camron','Camryn','Camylle','Candace','Candelario','Candice','Candida','Candido','Cara','Carey','Carissa','Carlee','Carleton','Carley','Carli','Carlie','Carlo','Carlos','Carlotta','Carmel','Carmela','Carmella','Carmelo','Carmen','Carmine','Carol','Carolanne','Carole','Carolina','Caroline','Carolyn','Carolyne','Carrie','Carroll','Carson','Carter','Cary','Casandra','Casey','Casimer','Casimir','Casper','Cassandra','Cassandre','Cassidy','Cassie','Catalina','Caterina','Catharine','Catherine','Cathrine','Cathryn','Cathy','Cayla','Ceasar','Cecelia','Cecil','Cecile','Cecilia','Cedrick','Celestine','Celestino','Celia','Celine','Cesar','Chad','Chadd','Chadrick','Chaim','Chance','Chandler','Chanel','Chanelle','Charity','Charlene','Charles','Charley','Charlie','Charlotte','Chase','Chasity','Chauncey','Chaya','Chaz','Chelsea','Chelsey','Chelsie','Chesley','Chester','Chet','Cheyanne','Cheyenne','Chloe','Chris','Christ','Christa','Christelle','Christian','Christiana','Christina','Christine','Christop','Christophe','Christopher','Christy','Chyna','Ciara','Cicero','Cielo','Cierra','Cindy','Citlalli','Clair','Claire','Clara','Clarabelle','Clare','Clarissa','Clark','Claud','Claude','Claudia','Claudie','Claudine','Clay','Clemens','Clement','Clementina','Clementine','Clemmie','Cleo','Cleora','Cleta','Cletus','Cleve','Cleveland','Clifford','Clifton','Clint','Clinton','Clotilde','Clovis','Cloyd','Clyde','Coby','Cody','Colby','Cole','Coleman','Colin','Colleen','Collin','Colt','Colten','Colton','Columbus','Concepcion','Conner','Connie','Connor','Conor','Conrad','Constance','Constantin','Consuelo','Cooper','Cora','Coralie','Corbin','Cordelia','Cordell','Cordia','Cordie','Corene','Corine','Cornelius','Cornell','Corrine','Cortez','Cortney','Cory','Coty','Courtney','Coy','Craig','Crawford','Creola','Cristal','Cristian','Cristina','Cristobal','Cristopher','Cruz','Crystal','Crystel','Cullen','Curt','Curtis','Cydney','Cynthia','Cyril','Cyrus',
'Dagmar','Dahlia','Daija','Daisha','Daisy','Dakota','Dale','Dallas','Dallin','Dalton','Damaris','Dameon','Damian','Damien','Damion','Damon','Dan','Dana','Dandre','Dane','D\'angelo','Dangelo','Danial','Daniela','Daniella','Danielle','Danika','Dannie','Danny','Dante','Danyka','Daphne','Daphnee','Daphney','Darby','Daren','Darian','Dariana','Darien','Dario','Darion','Darius','Darlene','Daron','Darrel','Darrell','Darren','Darrick','Darrin','Darrion','Darron','Darryl','Darwin','Daryl','Dashawn','Dasia','Dave','David','Davin','Davion','Davon','Davonte','Dawn','Dawson','Dax','Dayana','Dayna','Dayne','Dayton','Dean','Deangelo','Deanna','Deborah','Declan','Dedric','Dedrick','Dee','Deion','Deja','Dejah','Dejon','Dejuan','Delaney','Delbert','Delfina','Delia','Delilah','Dell','Della','Delmer','Delores','Delpha','Delphia','Delphine','Delta','Demarco','Demarcus','Demario','Demetris','Demetrius','Demond','Dena','Denis','Dennis','Deon','Deondre','Deontae','Deonte','Dereck','Derek','Derick','Deron','Derrick','Deshaun','Deshawn','Desiree','Desmond','Dessie','Destany','Destin','Destinee','Destiney','Destini','Destiny','Devan','Devante','Deven','Devin','Devon','Devonte','Devyn','Dewayne','Dewitt','Dexter','Diamond','Diana','Dianna','Diego','Dillan','Dillon','Dimitri','Dina','Dino','Dion','Dixie','Dock','Dolly','Dolores','Domenic','Domenica','Domenick','Domenico','Domingo','Dominic','Dominique','Don','Donald','Donato','Donavon','Donna','Donnell','Donnie','Donny','Dora','Dorcas','Dorian','Doris','Dorothea','Dorothy','Dorris','Dortha','Dorthy','Doug','Douglas','Dovie','Doyle','Drake','Drew','Duane','Dudley','Dulce','Duncan','Durward','Dustin','Dusty','Dwight','Dylan',
'Earl','Earlene','Earline','Earnest','Earnestine','Easter','Easton','Ebba','Ebony','Ed','Eda','Edd','Eddie','Eden','Edgar','Edgardo','Edison','Edmond','Edmund','Edna','Eduardo','Edward','Edwardo','Edwin','Edwina','Edyth','Edythe','Effie','Efrain','Efren','Eileen','Einar','Eino','Eladio','Elaina','Elbert','Elda','Eldon','Eldora','Eldred','Eldridge','Eleanora','Eleanore','Eleazar','Electa','Elena','Elenor','Elenora','Eleonore','Elfrieda','Eli','Elian','Eliane','Elias','Eliezer','Elijah','Elinor','Elinore','Elisa','Elisabeth','Elise','Eliseo','Elisha','Elissa','Eliza','Elizabeth','Ella','Ellen','Ellie','Elliot','Elliott','Ellis','Ellsworth','Elmer','Elmira','Elmo','Elmore','Elna','Elnora','Elody','Eloisa','Eloise','Elouise','Eloy','Elroy','Elsa','Else','Elsie','Elta','Elton','Elva','Elvera','Elvie','Elvis','Elwin','Elwyn','Elyse','Elyssa','Elza','Emanuel','Emelia','Emelie','Emely','Emerald','Emerson','Emery','Emie','Emil','Emile','Emilia','Emiliano','Emilie','Emilio','Emily','Emma','Emmalee','Emmanuel','Emmanuelle','Emmet','Emmett','Emmie','Emmitt','Emmy','Emory','Ena','Enid','Enoch','Enola','Enos','Enrico','Enrique','Ephraim','Era','Eriberto','Eric','Erica','Erich','Erick','Ericka','Erik','Erika','Erin','Erling','Erna','Ernest','Ernestina','Ernestine','Ernesto','Ernie','Ervin','Erwin','Eryn','Esmeralda','Esperanza','Esta','Esteban','Estefania','Estel','Estell','Estella','Estelle','Estevan','Esther','Estrella','Etha','Ethan','Ethel','Ethelyn','Ethyl','Ettie','Eudora','Eugene','Eugenia','Eula','Eulah','Eulalia','Euna','Eunice','Eusebio','Eva','Evalyn','Evan','Evangeline','Evans','Eve','Eveline','Evelyn','Everardo','Everett','Everette','Evert','Evie','Ewald','Ewell','Ezekiel','Ezequiel','Ezra',
'Fabian','Fabiola','Fae','Fannie','Fanny','Fatima','Faustino','Fausto','Favian','Fay','Faye','Federico','Felicia','Felicita','Felicity','Felipa','Felipe','Felix','Felton','Fermin','Fern','Fernando','Ferne','Fidel','Filiberto','Filomena','Finn','Fiona','Flavie','Flavio','Fleta','Fletcher','Flo','Florence','Florencio','Florian','Florida','Florine','Flossie','Floy','Floyd','Ford','Forest','Forrest','Foster','Frances','Francesca','Francesco','Francis','Francisca','Francisco','Franco','Frank','Frankie','Franz','Fred','Freda','Freddie','Freddy','Frederic','Frederick','Frederik','Frederique','Fredrick','Fredy','Freeda','Freeman','Freida','Frida','Frieda','Friedrich','Fritz','Furman',
'Gabe','Gabriel','Gabriella','Gabrielle','Gaetano','Gage','Gail','Gardner','Garett','Garfield','Garland','Garnet','Garnett','Garret','Garrett','Garrick','Garrison','Garry','Garth','Gaston','Gavin','Gay','Gayle','Gaylord','Gene','General','Genesis','Genevieve','Gennaro','Genoveva','Geo','Geoffrey','George','Georgette','Georgiana','Georgianna','Geovanni','Geovanny','Geovany','Gerald','Geraldine','Gerard','Gerardo','Gerda','Gerhard','Germaine','German','Gerry','Gerson','Gertrude','Gia','Gianni','Gideon','Gilbert','Gilberto','Gilda','Giles','Gillian','Gina','Gino','Giovani','Giovanna','Giovanni','Giovanny','Gisselle','Giuseppe','Gladyce','Gladys','Glen','Glenda','Glenna','Glennie','Gloria','Godfrey','Golda','Golden','Gonzalo','Gordon','Grace','Gracie','Graciela','Grady','Graham','Grant','Granville','Grayce','Grayson','Green','Greg','Gregg','Gregoria','Gregorio','Gregory','Greta','Gretchen','Greyson','Griffin','Grover','Guadalupe','Gudrun','Guido','Guillermo','Guiseppe','Gunnar','Gunner','Gus','Gussie','Gust','Gustave','Guy','Gwen','Gwendolyn',
'Hadley','Hailee','Hailey','Hailie','Hal','Haleigh','Haley','Halie','Halle','Hallie','Hank','Hanna','Hannah','Hans','Hardy','Harley','Harmon','Harmony','Harold','Harrison','Harry','Harvey','Haskell','Hassan','Hassie','Hattie','Haven','Hayden','Haylee','Hayley','Haylie','Hazel','Hazle','Heath','Heather','Heaven','Heber','Hector','Heidi','Helen','Helena','Helene','Helga','Hellen','Helmer','Heloise','Henderson','Henri','Henriette','Henry','Herbert','Herman','Hermann','Hermina','Herminia','Herminio','Hershel','Herta','Hertha','Hester','Hettie','Hilario','Hilbert','Hilda','Hildegard','Hillard','Hillary','Hilma','Hilton','Hipolito','Hiram','Hobart','Holden','Hollie','Hollis','Holly','Hope','Horace','Horacio','Hortense','Hosea','Houston','Howard','Howell','Hoyt','Hubert','Hudson','Hugh','Hulda','Humberto','Hunter','Hyman',
'Ian','Ibrahim','Icie','Ida','Idell','Idella','Ignacio','Ignatius','Ike','Ila','Ilene','Iliana','Ima','Imani','Imelda','Immanuel','Imogene','Ines','Irma','Irving','Irwin','Isaac','Isabel','Isabell','Isabella','Isabelle','Isac','Isadore','Isai','Isaiah','Isaias','Isidro','Ismael','Isobel','Isom','Israel','Issac','Itzel','Iva','Ivah','Ivory','Ivy','Izabella','Izaiah',
'Jabari','Jace','Jacey','Jacinthe','Jacinto','Jack','Jackeline','Jackie','Jacklyn','Jackson','Jacky','Jaclyn','Jacquelyn','Jacques','Jacynthe','Jada','Jade','Jaden','Jadon','Jadyn','Jaeden','Jaida','Jaiden','Jailyn','Jaime','Jairo','Jakayla','Jake','Jakob','Jaleel','Jalen','Jalon','Jalyn','Jamaal','Jamal','Jamar','Jamarcus','Jamel','Jameson','Jamey','Jamie','Jamil','Jamir','Jamison','Jammie','Jan','Jana','Janae','Jane','Janelle','Janessa','Janet','Janice','Janick','Janie','Janis','Janiya','Jannie','Jany','Jaquan','Jaquelin','Jaqueline','Jared','Jaren','Jarod','Jaron','Jarred','Jarrell','Jarret','Jarrett','Jarrod','Jarvis','Jasen','Jasmin','Jason','Jasper','Jaunita','Javier','Javon','Javonte','Jay','Jayce','Jaycee','Jayda','Jayde','Jayden','Jaydon','Jaylan','Jaylen','Jaylin','Jaylon','Jayme','Jayne','Jayson','Jazlyn','Jazmin','Jazmyn','Jazmyne','Jean','Jeanette','Jeanie','Jeanne','Jed','Jedediah','Jedidiah','Jeff','Jefferey','Jeffery','Jeffrey','Jeffry','Jena','Jenifer','Jennie','Jennifer','Jennings','Jennyfer','Jensen','Jerad','Jerald','Jeramie','Jeramy','Jerel','Jeremie','Jeremy','Jermain','Jermaine','Jermey','Jerod','Jerome','Jeromy','Jerrell','Jerrod','Jerrold','Jerry','Jess','Jesse','Jessica','Jessie','Jessika','Jessy','Jessyca','Jesus','Jett','Jettie','Jevon','Jewel','Jewell','Jillian','Jimmie','Jimmy','Jo','Joan','Joana','Joanie','Joanne','Joannie','Joanny','Joany','Joaquin','Jocelyn','Jodie','Jody','Joe','Joel','Joelle','Joesph','Joey','Johan','Johann','Johanna','Johathan','John','Johnathan','Johnathon','Johnnie','Johnny','Johnpaul','Johnson','Jolie','Jon','Jonas','Jonatan','Jonathan','Jonathon','Jordan','Jordane','Jordi','Jordon','Jordy','Jordyn','Jorge','Jose','Josefa','Josefina','Joseph','Josephine','Josh','Joshua','Joshuah','Josiah','Josiane','Josianne','Josie','Josue','Jovan','Jovani','Jovanny','Jovany','Joy','Joyce','Juana','Juanita','Judah','Judd','Jude','Judge','Judson','Judy','Jules','Julia','Julian','Juliana','Julianne','Julie','Julien','Juliet','Julio','Julius','June','Junior','Junius','Justen','Justice','Justina','Justine','Juston','Justus','Justyn','Juvenal','Juwan',
'Kacey','Kaci','Kacie','Kade','Kaden','Kadin','Kaela','Kaelyn','Kaia','Kailee','Kailey','Kailyn','Kaitlin','Kaitlyn','Kale','Kaleb','Kaleigh','Kaley','Kali','Kallie','Kameron','Kamille','Kamren','Kamron','Kamryn','Kane','Kara','Kareem','Karelle','Karen','Kari','Kariane','Karianne','Karina','Karine','Karl','Karlee','Karley','Karli','Karlie','Karolann','Karson','Kasandra','Kasey','Kassandra','Katarina','Katelin','Katelyn','Katelynn','Katharina','Katherine','Katheryn','Kathleen','Kathlyn','Kathryn','Kathryne','Katlyn','Katlynn','Katrina','Katrine','Kattie','Kavon','Kay','Kaya','Kaycee','Kayden','Kayla','Kaylah','Kaylee','Kayleigh','Kayley','Kayli','Kaylie','Kaylin','Keagan','Keanu','Keara','Keaton','Keegan','Keeley','Keely','Keenan','Keira','Keith','Kellen','Kelley','Kelli','Kellie','Kelly','Kelsi','Kelsie','Kelton','Kelvin','Ken','Kendall','Kendra','Kendrick','Kenna','Kennedi','Kennedy','Kenneth','Kennith','Kenny','Kenton','Kenya','Kenyatta','Kenyon','Keon','Keshaun','Keshawn','Keven','Kevin','Kevon','Keyon','Keyshawn','Khalid','Khalil','Kian','Kiana','Kianna','Kiara','Kiarra','Kiel','Kiera','Kieran','Kiley','Kim','Kimberly','King','Kip','Kira','Kirk','Kirsten','Kirstin','Kitty','Kobe','Koby','Kody','Kolby','Kole','Korbin','Korey','Kory','Kraig','Kris','Krista','Kristian','Kristin','Kristina','Kristofer','Kristoffer','Kristopher','Kristy','Krystal','Krystel','Krystina','Kurt','Kurtis','Kyla','Kyle','Kylee','Kyleigh','Kyler','Kylie','Kyra',
'Lacey','Lacy','Ladarius','Lafayette','Laila','Laisha','Lamar','Lambert','Lamont','Lance','Landen','Lane','Laney','Larissa','Laron','Larry','Larue','Laura','Laurel','Lauren','Laurence','Lauretta','Lauriane','Laurianne','Laurie','Laurine','Laury','Lauryn','Lavada','Lavern','Laverna','Laverne','Lavina','Lavinia','Lavon','Lavonne','Lawrence','Lawson','Layla','Layne','Lazaro','Lea','Leann','Leanna','Leanne','Leatha','Leda','Lee','Leif','Leila','Leilani','Lela','Lelah','Leland','Lelia','Lempi','Lemuel','Lenna','Lennie','Lenny','Lenora','Lenore','Leo','Leola','Leon','Leonard','Leonardo','Leone','Leonel','Leonie','Leonor','Leonora','Leopold','Leopoldo','Leora','Lera','Lesley','Leslie','Lesly','Lessie','Lester','Leta','Letha','Letitia','Levi','Lew','Lewis','Lexi','Lexie','Lexus','Lia','Liam','Liana','Libbie','Libby','Lila','Lilian','Liliana','Liliane','Lilla','Lillian','Lilliana','Lillie','Lilly','Lily','Lilyan','Lina','Lincoln','Linda','Lindsay','Lindsey','Linnea','Linnie','Linwood','Lionel','Lisa','Lisandro','Lisette','Litzy','Liza','Lizeth','Lizzie','Llewellyn','Lloyd','Logan','Lois','Lola','Lolita','Loma','Lon','London','Lonie','Lonnie','Lonny','Lonzo','Lora','Loraine','Loren','Lorena','Lorenz','Lorenza','Lorenzo','Lori','Lorine','Lorna','Lottie','Lou','Louie','Louisa','Lourdes','Louvenia','Lowell','Loy','Loyal','Loyce','Lucas','Luciano','Lucie','Lucienne','Lucile','Lucinda','Lucio','Lucious','Lucius','Lucy','Ludie','Ludwig','Lue','Luella','Luigi','Luis','Luisa','Lukas','Lula','Lulu','Luna','Lupe','Lura','Lurline','Luther','Luz','Lyda','Lydia','Lyla','Lynn','Lyric','Lysanne',
'Mabel','Mabelle','Mable','Mac','Macey','Maci','Macie','Mack','Mackenzie','Macy','Madaline','Madalyn','Maddison','Madeline','Madelyn','Madelynn','Madge','Madie','Madilyn','Madisen','Madison','Madisyn','Madonna','Madyson','Mae','Maegan','Maeve','Mafalda','Magali','Magdalen','Magdalena','Maggie','Magnolia','Magnus','Maia','Maida','Maiya','Major','Makayla','Makenna','Makenzie','Malachi','Malcolm','Malika','Malinda','Mallie','Mallory','Malvina','Mandy','Manley','Manuel','Manuela','Mara','Marc','Marcel','Marcelina','Marcelino','Marcella','Marcelle','Marcellus','Marcelo','Marcia','Marco','Marcos','Marcus','Margaret','Margarete','Margarett','Margaretta','Margarette','Margarita','Marge','Margie','Margot','Margret','Marguerite','Maria','Mariah','Mariam','Marian','Mariana','Mariane','Marianna','Marianne','Mariano','Maribel','Marie','Mariela','Marielle','Marietta','Marilie','Marilou','Marilyne','Marina','Mario','Marion','Marisa','Marisol','Maritza','Marjolaine','Marjorie','Marjory','Mark','Markus','Marlee','Marlen','Marlene','Marley','Marlin','Marlon','Marques','Marquis','Marquise','Marshall','Marta','Martin','Martina','Martine','Marty','Marvin','Mary','Maryam','Maryjane','Maryse','Mason','Mateo','Mathew','Mathias','Mathilde','Matilda','Matilde','Matt','Matteo','Mattie','Maud','Maude','Maudie','Maureen','Maurice','Mauricio','Maurine','Maverick','Mavis','Max','Maxie','Maxime','Maximilian','Maximillia','Maximillian','Maximo','Maximus','Maxine','Maxwell','May','Maya','Maybell','Maybelle','Maye','Maymie','Maynard','Mayra','Mazie','Mckayla','Mckenna','Mckenzie','Meagan','Meaghan','Meda','Megane','Meggie','Meghan','Mekhi','Melany','Melba','Melisa','Melissa','Mellie','Melody','Melvin','Melvina','Melyna','Melyssa','Mercedes','Meredith','Merl','Merle','Merlin','Merritt','Mertie','Mervin','Meta','Mia','Micaela','Micah','Michael','Michaela','Michale','Micheal','Michel','Michele','Michelle','Miguel','Mikayla','Mike','Mikel','Milan','Miles','Milford','Miller','Millie','Milo','Milton','Mina','Minerva','Minnie','Miracle','Mireille','Mireya','Misael','Missouri','Misty','Mitchel','Mitchell','Mittie','Modesta','Modesto','Mohamed','Mohammad','Mohammed','Moises','Mollie','Molly','Mona','Monica','Monique','Monroe','Monserrat','Monserrate','Montana','Monte','Monty','Morgan','Moriah','Morris','Mortimer','Morton','Mose','Moses','Moshe','Mossie','Mozell','Mozelle','Muhammad','Muriel','Murl','Murphy','Murray','Mustafa','Mya','Myah','Mylene','Myles','Myra','Myriam','Myrl','Myrna','Myron','Myrtice','Myrtie','Myrtis','Myrtle',
'Nadia','Nakia','Name','Nannie','Naomi','Naomie','Napoleon','Narciso','Nash','Nasir','Nat','Natalia','Natalie','Natasha','Nathan','Nathanael','Nathanial','Nathaniel','Nathen','Nayeli','Neal','Ned','Nedra','Neha','Neil','Nelda','Nella','Nelle','Nellie','Nels','Nelson','Neoma','Nestor','Nettie','Neva','Newell','Newton','Nia','Nicholas','Nicholaus','Nichole','Nick','Nicklaus','Nickolas','Nico','Nicola','Nicolas','Nicole','Nicolette','Nigel','Nikita','Nikki','Nikko','Niko','Nikolas','Nils','Nina','Noah','Noble','Noe','Noel','Noelia','Noemi','Noemie','Noemy','Nola','Nolan','Nona','Nora','Norbert','Norberto','Norene','Norma','Norris','Norval','Norwood','Nova','Novella','Nya','Nyah','Nyasia',
'Obie','Oceane','Ocie','Octavia','Oda','Odell','Odessa','Odie','Ofelia','Okey','Ola','Olaf','Ole','Olen','Oleta','Olga','Olin','Oliver','Ollie','Oma','Omari','Omer','Ona','Onie','Opal','Ophelia','Ora','Oral','Oran','Oren','Orie','Orin','Orion','Orland','Orlando','Orlo','Orpha','Orrin','Orval','Orville','Osbaldo','Osborne','Oscar','Osvaldo','Oswald','Oswaldo','Otha','Otho','Otilia','Otis','Ottilie','Ottis','Otto','Ova','Owen','Ozella',
'Pablo','Paige','Palma','Pamela','Pansy','Paolo','Paris','Parker','Pascale','Pasquale','Pat','Patience','Patricia','Patrick','Patsy','Pattie','Paul','Paula','Pauline','Paxton','Payton','Pearl','Pearlie','Pearline','Pedro','Peggie','Penelope','Percival','Percy','Perry','Pete','Peter','Petra','Peyton','Philip','Phoebe','Phyllis','Pierce','Pierre','Pietro','Pink','Pinkie','Piper','Polly','Porter','Precious','Presley','Preston','Price','Prince','Princess','Priscilla','Providenci','Prudence',
'Queen','Queenie','Quentin','Quincy','Quinn','Quinten','Quinton',
'Rachael','Rachel','Rachelle','Rae','Raegan','Rafael','Rafaela','Raheem','Rahsaan','Rahul','Raina','Raleigh','Ralph','Ramiro','Ramon','Ramona','Randal','Randall','Randi','Randy','Ransom','Raoul','Raphael','Raphaelle','Raquel','Rashad','Rashawn','Rasheed','Raul','Raven','Ray','Raymond','Raymundo','Reagan','Reanna','Reba','Rebeca','Rebecca','Rebeka','Rebekah','Reece','Reed','Reese','Regan','Reggie','Reginald','Reid','Reilly','Reina','Reinhold','Remington','Rene','Renee','Ressie','Reta','Retha','Retta','Reuben','Reva','Rex','Rey','Reyes','Reymundo','Reyna','Reynold','Rhea','Rhett','Rhianna','Rhiannon','Rhoda','Ricardo','Richard','Richie','Richmond','Rick','Rickey','Rickie','Ricky','Rico','Rigoberto','Riley','Rita','River','Robb','Robbie','Robert','Roberta','Roberto','Robin','Robyn','Rocio','Rocky','Rod','Roderick','Rodger','Rodolfo','Rodrick','Rodrigo','Roel','Rogelio','Roger','Rogers','Rolando','Rollin','Roma','Romaine','Roman','Ron','Ronaldo','Ronny','Roosevelt','Rory','Rosa','Rosalee','Rosalia','Rosalind','Rosalinda','Rosalyn','Rosamond','Rosanna','Rosario','Roscoe','Rose','Rosella','Roselyn','Rosemarie','Rosemary','Rosendo','Rosetta','Rosie','Rosina','Roslyn','Ross','Rossie','Rowan','Rowena','Rowland','Roxane','Roxanne','Roy','Royal','Royce','Rozella','Ruben','Rubie','Ruby','Rubye','Rudolph','Rudy','Rupert','Russ','Russel','Russell','Rusty','Ruth','Ruthe','Ruthie','Ryan','Ryann','Ryder','Rylan','Rylee','Ryleigh','Ryley',
'Sabina','Sabrina','Sabryna','Sadie','Sadye','Sage','Saige','Sallie','Sally','Salma','Salvador','Salvatore','Sam','Samanta','Samantha','Samara','Samir','Sammie','Sammy','Samson','Sandra','Sandrine','Sandy','Sanford','Santa','Santiago','Santina','Santino','Santos','Sarah','Sarai','Sarina','Sasha','Saul','Savanah','Savanna','Savannah','Savion','Scarlett','Schuyler','Scot','Scottie','Scotty','Seamus','Sean','Sebastian','Sedrick','Selena','Selina','Selmer','Serena','Serenity','Seth','Shad','Shaina','Shakira','Shana','Shane','Shanel','Shanelle','Shania','Shanie','Shaniya','Shanna','Shannon','Shanny','Shanon','Shany','Sharon','Shaun','Shawn','Shawna','Shaylee','Shayna','Shayne','Shea','Sheila','Sheldon','Shemar','Sheridan','Sherman','Sherwood','Shirley','Shyann','Shyanne','Sibyl','Sid','Sidney','Sienna','Sierra','Sigmund','Sigrid','Sigurd','Silas','Sim','Simeon','Simone','Sincere','Sister','Skye','Skyla','Skylar','Sofia','Soledad','Solon','Sonia','Sonny','Sonya','Sophia','Sophie','Spencer','Stacey','Stacy','Stan','Stanford','Stanley','Stanton','Stefan','Stefanie','Stella','Stephan','Stephania','Stephanie','Stephany','Stephen','Stephon','Sterling','Steve','Stevie','Stewart','Stone','Stuart','Summer','Sunny','Susan','Susana','Susanna','Susie','Suzanne','Sven','Syble','Sydnee','Sydney','Sydni','Sydnie','Sylvan','Sylvester','Sylvia',
'Tabitha','Tad','Talia','Talon','Tamara','Tamia','Tania','Tanner','Tanya','Tara','Taryn','Tate','Tatum','Tatyana','Taurean','Tavares','Taya','Taylor','Teagan','Ted','Telly','Terence','Teresa','Terrance','Terrell','Terrence','Terrill','Terry','Tess','Tessie','Tevin','Thad','Thaddeus','Thalia','Thea','Thelma','Theo','Theodora','Theodore','Theresa','Therese','Theresia','Theron','Thomas','Thora','Thurman','Tia','Tiana','Tianna','Tiara','Tierra','Tiffany','Tillman','Timmothy','Timmy','Timothy','Tina','Tito','Titus','Tobin','Toby','Tod','Tom','Tomas','Tomasa','Tommie','Toney','Toni','Tony','Torey','Torrance','Torrey','Toy','Trace','Tracey','Tracy','Travis','Travon','Tre','Tremaine','Tremayne','Trent','Trenton','Tressa','Tressie','Treva','Trever','Trevion','Trevor','Trey','Trinity','Trisha','Tristian','Tristin','Triston','Troy','Trudie','Trycia','Trystan','Turner','Twila','Tyler','Tyra','Tyree','Tyreek','Tyrel','Tyrell','Tyrese','Tyrique','Tyshawn','Tyson','Ubaldo',
'Ulices','Ulises','Una','Unique','Urban','Uriah','Uriel','Ursula',
'Vada','Valentin','Valentina','Valentine','Valerie','Vallie','Van','Vance','Vanessa','Vaughn','Veda','Velda','Vella','Velma','Velva','Vena','Verda','Verdie','Vergie','Verla','Verlie','Vern','Verna','Verner','Vernice','Vernie','Vernon','Verona','Veronica','Vesta','Vicenta','Vicente','Vickie','Vicky','Victor','Victoria','Vida','Vidal','Vilma','Vince','Vincent','Vincenza','Vincenzo','Vinnie','Viola','Violet','Violette','Virgie','Virgil','Virginia','Virginie','Vita','Vito','Viva','Vivian','Viviane','Vivianne','Vivien','Vivienne','Vladimir',
'Wade','Waino','Waldo','Walker','Wallace','Walter','Walton','Wanda','Ward','Warren','Watson','Wava','Waylon','Wayne','Webster','Weldon','Wellington','Wendell','Wendy','Werner','Westley','Weston','Whitney','Wilber','Wilbert','Wilburn','Wiley','Wilford','Wilfred','Wilfredo','Wilfrid','Wilhelm','Wilhelmine','Will','Willa','Willard','William','Willie','Willis','Willow','Willy','Wilma','Wilmer','Wilson','Wilton','Winfield','Winifred','Winnifred','Winona','Winston','Woodrow','Wyatt','Wyman','Xander',
'Xavier','Xzavier',
'Yadira','Yasmeen','Yasmin','Yasmine','Yazmin','Yesenia','Yessenia','Yolanda','Yoshiko','Yvette','Yvonne',
'Zachariah','Zachary','Zachery','Zack','Zackary','Zackery','Zakary','Zander','Zane','Zaria','Zechariah','Zelda','Zella','Zelma','Zena','Zetta','Zion','Zita','Zoe','Zoey','Zoie','Zoila','Zola','Zora','Zula'
);
protected static $lastName = array(
'Abbott','Abernathy','Abshire','Adams','Altenwerth','Anderson','Ankunding','Armstrong','Auer','Aufderhar',
'Bahringer','Bailey','Balistreri','Barrows','Bartell','Bartoletti','Barton','Bashirian','Batz','Bauch','Baumbach','Bayer','Beahan','Beatty','Bechtelar','Becker','Bednar','Beer','Beier','Berge','Bergnaum','Bergstrom','Bernhard','Bernier','Bins','Blanda','Blick','Block','Bode','Boehm','Bogan','Bogisich','Borer','Bosco','Botsford','Boyer','Boyle','Bradtke','Brakus','Braun','Breitenberg','Brekke','Brown','Bruen','Buckridge',
'Carroll','Carter','Cartwright','Casper','Cassin','Champlin','Christiansen','Cole','Collier','Collins','Conn','Connelly','Conroy','Considine','Corkery','Cormier','Corwin','Cremin','Crist','Crona','Cronin','Crooks','Cruickshank','Cummerata','Cummings',
'Dach','D\'Amore','Daniel','Dare','Daugherty','Davis','Deckow','Denesik','Dibbert','Dickens','Dicki','Dickinson','Dietrich','Donnelly','Dooley','Douglas','Doyle','DuBuque','Durgan',
'Ebert','Effertz','Eichmann','Emard','Emmerich','Erdman','Ernser','Fadel',
'Fahey','Farrell','Fay','Feeney','Feest','Feil','Ferry','Fisher','Flatley','Frami','Franecki','Friesen','Fritsch','Funk',
'Gaylord','Gerhold','Gerlach','Gibson','Gislason','Gleason','Gleichner','Glover','Goldner','Goodwin','Gorczany','Gottlieb','Goyette','Grady','Graham','Grant','Green','Greenfelder','Greenholt','Grimes','Gulgowski','Gusikowski','Gutkowski','Gutmann',
'Haag','Hackett','Hagenes','Hahn','Haley','Halvorson','Hamill','Hammes','Hand','Hane','Hansen','Harber','Harris','Hartmann','Harvey','Hauck','Hayes','Heaney','Heathcote','Hegmann','Heidenreich','Heller','Herman','Hermann','Hermiston','Herzog','Hessel','Hettinger','Hickle','Hilll','Hills','Hilpert','Hintz','Hirthe','Hodkiewicz','Hoeger','Homenick','Hoppe','Howe','Howell','Hudson','Huel','Huels','Hyatt',
'Jacobi','Jacobs','Jacobson','Jakubowski','Jaskolski','Jast','Jenkins','Jerde','Jewess','Johns','Johnson','Johnston','Jones',
'Kassulke','Kautzer','Keebler','Keeling','Kemmer','Kerluke','Kertzmann','Kessler','Kiehn','Kihn','Kilback','King','Kirlin','Klein','Kling','Klocko','Koch','Koelpin','Koepp','Kohler','Konopelski','Koss','Kovacek','Kozey','Krajcik','Kreiger','Kris','Kshlerin','Kub','Kuhic','Kuhlman','Kuhn','Kulas','Kunde','Kunze','Kuphal','Kutch','Kuvalis',
'Labadie','Lakin','Lang','Langosh','Langworth','Larkin','Larson','Leannon','Lebsack','Ledner','Leffler','Legros','Lehner','Lemke','Lesch','Leuschke','Lind','Lindgren','Littel','Little','Lockman','Lowe','Lubowitz','Lueilwitz','Luettgen','Lynch',
'Macejkovic','Maggio','Mann','Mante','Marks','Marquardt','Marvin','Mayer','Mayert','McClure','McCullough','McDermott','McGlynn','McKenzie','McLaughlin','Medhurst','Mertz','Metz','Miller','Mills','Mitchell','Moen','Mohr','Monahan','Moore','Morar','Morissette','Mosciski','Mraz','Mueller','Muller','Murazik','Murphy','Murray',
'Nader','Nicolas','Nienow','Nikolaus','Nitzsche','Nolan',
'Oberbrunner','O\'Connell','O\'Conner','O\'Hara','O\'Keefe','O\'Kon','Okuneva','Olson','Ondricka','O\'Reilly','Orn','Ortiz','Osinski',
'Pacocha','Padberg','Pagac','Parisian','Parker','Paucek','Pfannerstill','Pfeffer','Pollich','Pouros','Powlowski','Predovic','Price','Prohaska','Prosacco','Purdy',
'Quigley','Quitzon',
'Rath','Ratke','Rau','Raynor','Reichel','Reichert','Reilly','Reinger','Rempel','Renner','Reynolds','Rice','Rippin','Ritchie','Robel','Roberts','Rodriguez','Rogahn','Rohan','Rolfson','Romaguera','Roob','Rosenbaum','Rowe','Ruecker','Runolfsdottir','Runolfsson','Runte','Russel','Rutherford','Ryan','Sanford','Satterfield','Sauer','Sawayn',
'Schaden','Schaefer','Schamberger','Schiller','Schimmel','Schinner','Schmeler','Schmidt','Schmitt','Schneider','Schoen','Schowalter','Schroeder','Schulist','Schultz','Schumm','Schuppe','Schuster','Senger','Shanahan','Shields','Simonis','Sipes','Skiles','Smith','Smitham','Spencer','Spinka','Sporer','Stamm','Stanton','Stark','Stehr','Steuber','Stiedemann','Stokes','Stoltenberg','Stracke','Streich','Stroman','Strosin','Swaniawski','Swift',
'Terry','Thiel','Thompson','Tillman','Torp','Torphy','Towne','Toy','Trantow','Tremblay','Treutel','Tromp','Turcotte','Turner',
'Ullrich','Upton',
'Vandervort','Veum','Volkman','Von','VonRueden',
'Waelchi','Walker','Walsh','Walter','Ward','Waters','Watsica','Weber','Wehner','Weimann','Weissnat','Welch','West','White','Wiegand','Wilderman','Wilkinson','Will','Williamson','Willms','Windler','Wintheiser','Wisoky','Wisozk','Witting','Wiza','Wolf','Wolff','Wuckert','Wunsch','Wyman',
'Yost','Yundt',
'Zboncak','Zemlak','Ziemann','Zieme','Zulauf'
);
private static $prefix = array('Mr.','Mrs.','Ms.','Miss','Dr.');
private static $suffix = array('Jr.','Sr.','I','II','III','IV','V','MD','DDS','PhD','DVM');
protected $generator;
public function __construct($generator)
{
$this->generator = $generator;
}
public function name()
{
$format = self::$formats[array_rand(self::$formats)];
return $this->generator->parse($format);
}
public static function firstName()
{
return self::$firstName[array_rand(self::$firstName)];
}
public static function lastName()
{
return self::$lastName[array_rand(self::$lastName)];
}
public static function prefix()
{
return self::$prefix[array_rand(self::$prefix)];
}
public static function suffix()
{
return self::$suffix[array_rand(self::$suffix)];
}
}

View File

@ -0,0 +1,45 @@
<?php
namespace Faker\Provider;
class PhoneNumber
{
protected static $formats = array(
'+##(#)##########',
'+##(#)##########',
'0##########',
'0##########',
'###-###-####',
'(###)###-####',
'1-###-###-####',
'###.###.####',
'###-###-####',
'(###)###-####',
'1-###-###-####',
'###.###.####',
'###-###-####x###',
'(###)###-####x###',
'1-###-###-####x###',
'###.###.####x###',
'###-###-####x####',
'(###)###-####x####',
'1-###-###-####x####',
'###.###.####x####',
'###-###-####x#####',
'(###)###-####x#####',
'1-###-###-####x#####',
'###.###.####x#####'
);
protected $generator;
public function __construct($generator)
{
$this->generator = $generator;
}
public function phoneNumber()
{
return $this->generator->numerify(self::$formats[array_rand(self::$formats)]);
}
}

172
test/GeneratorTest.php Normal file
View File

@ -0,0 +1,172 @@
<?php
require_once __DIR__ . '/../src/Generator.php';
use Faker\Generator;
class GeneratorTest extends PHPUnit_Framework_TestCase
{
public function testGetFormatterReturnsCallable()
{
$generator = new Generator;
$provider = new FooProvider();
$generator->addProvider($provider);
$expected = array($provider, 'fooFormatter');
$this->assertTrue(is_callable($generator->getFormatter('fooFormatter')));
}
public function testGetFormatterReturnsCorrectFormatter()
{
$generator = new Generator;
$provider = new FooProvider();
$generator->addProvider($provider);
$expected = array($provider, 'fooFormatter');
$this->assertEquals($expected, $generator->getFormatter('fooFormatter'));
}
/**
* @expectedException InvalidArgumentException
*/
public function testGetFormatterThrowsExceptionOnIncorrectProvider()
{
$generator = new Generator;
$generator->getFormatter('fooFormatter');
}
/**
* @expectedException InvalidArgumentException
*/
public function testGetFormatterThrowsExceptionOnIncorrectFormatter()
{
$generator = new Generator;
$provider = new FooProvider();
$generator->addProvider($provider);
$generator->getFormatter('barFormatter');
}
public function testFormatCallsFormatterOnProvider()
{
$generator = new Generator;
$provider = new FooProvider();
$generator->addProvider($provider);
$this->assertEquals('foobar', $generator->format('fooFormatter'));
}
public function testFormatTransfersArgumentsToFormatter()
{
$generator = new Generator;
$provider = new FooProvider();
$generator->addProvider($provider);
$this->assertEquals('bazfoo', $generator->format('fooFormatterWithArguments', array('foo')));
}
public function testRandomDigitReturnsInteger()
{
$this->assertTrue(is_integer(Generator::randomDigit()));
}
public function testRandomDigitReturnsDigit()
{
$this->assertTrue(Generator::randomDigit() >= 0);
$this->assertTrue(Generator::randomDigit() < 10);
}
public function testRandomLetterReturnsString()
{
$this->assertTrue(is_string(Generator::randomLetter()));
}
public function testRandomLetterReturnsSingleLetter()
{
$this->assertEquals(1, strlen(Generator::randomLetter()));
}
public function testRandomLetterReturnsLowercaseLetter()
{
$lowercaseLetters = 'abcdefghijklmnopqrstuvwxyz';
$this->assertTrue(strpos($lowercaseLetters, Generator::randomLetter()) !== false);
}
public function testRandomElementReturnsElementFromArray()
{
$elements = array('23', 'e', 32, '#');
$this->assertContains(Generator::randomElement($elements), $elements);
}
public function testNumerifyReturnsSameStringWhenItContainsNoHashSign()
{
$this->assertEquals('fooBar?', Generator::numerify('fooBar?'));
}
public function testNumerifyReturnsStringWithHashSignsReplacedByDigits()
{
$this->assertRegExp('/foo\dBa\dr/', Generator::numerify('foo#Ba#r'));
}
public function testLexifyReturnsSameStringWhenItContainsNoQuestionMark()
{
$this->assertEquals('fooBar#', Generator::lexify('fooBar#'));
}
public function testNumerifyReturnsStringWithQuestionMarksReplacedByLetters()
{
$this->assertRegExp('/foo[a-z]Ba[a-z]r/', Generator::lexify('foo?Ba?r'));
}
public function testBothifyCombinesNumerifyAndLexify()
{
$this->assertRegExp('/foo[a-z]Ba\dr/', Generator::bothify('foo?Ba#r'));
}
public function testParseReturnsSameStringWhenItContainsNoCurlyBraces()
{
$generator = new Generator();
$this->assertEquals('fooBar#?', $generator->parse('fooBar#?'));
}
public function testParseReturnsStringWithTokensReplacedByFormatters()
{
$generator = new Generator();
$provider = new FooProvider();
$generator->addProvider($provider);
$this->assertEquals('This is foobar a text with foobar', $generator->parse('This is {{fooFormatter}} a text with {{ fooFormatter }}'));
}
public function testMagicGetCallsFormat()
{
$generator = new Generator;
$provider = new FooProvider();
$generator->addProvider($provider);
$this->assertEquals('foobar', $generator->fooFormatter);
}
public function testMagicCallCallsFormat()
{
$generator = new Generator;
$provider = new FooProvider();
$generator->addProvider($provider);
$this->assertEquals('foobar', $generator->fooFormatter());
}
public function testMagicCallCallsFormatWithArguments()
{
$generator = new Generator;
$provider = new FooProvider();
$generator->addProvider($provider);
$this->assertEquals('bazfoo', $generator->fooFormatterWithArguments('foo'));
}
}
class FooProvider
{
public function fooFormatter()
{
return 'foobar';
}
public function fooFormatterWithArguments($value = '')
{
return 'baz' . $value;
}
}

46
test/test.php Normal file
View File

@ -0,0 +1,46 @@
<?php
require_once __DIR__ . '/../src/Generator.php';
require_once __DIR__ . '/../src/Provider/Name.php';
require_once __DIR__ . '/../src/Provider/Address.php';
require_once __DIR__ . '/../src/Provider/PhoneNumber.php';
require_once __DIR__ . '/../src/Provider/Company.php';
require_once __DIR__ . '/../src/Provider/Lorem.php';
$generator = new Faker\Generator();
$generator->addProvider(new Faker\Provider\Name($generator));
$generator->addProvider(new Faker\Provider\Address($generator));
$generator->addProvider(new Faker\Provider\PhoneNumber($generator));
$generator->addProvider(new Faker\Provider\Company($generator));
$generator->addProvider(new Faker\Provider\Lorem($generator));
?>
<?xml version="1.0" encoding="UTF-8"?>
<contacts>
<?php for ($i=0; $i < 10; $i++): ?>
<contact firstName="<?php echo $generator->firstName ?>" lastName="<?php echo $generator->lastName ?>">
<phone number="<?php echo $generator->phoneNumber ?>"/>
<?php if (mt_rand(0,5) == 0): ?>
<countryOfBirth><?php echo $generator->address ?></countryOfBirth>
<?php endif; ?>
<address>
<street><?php echo $generator->streetAddress ?></street>
<city><?php echo $generator->city ?></city>
<postcode><?php echo $generator->postcode ?></postcode>
<state><?php echo $generator->state ?></state>
</address>
<company name="<?php echo $generator->company ?>" catchPhrase="<?php echo $generator->catchPhrase ?>">
<?php if (mt_rand(0,2) == 0): ?>
<offer><?php echo $generator->bs ?></offer>
<?php endif; ?>
<?php if (mt_rand(0,3) == 0): ?>
<director name="<?php echo $generator->name ?>"/>
<?php endif; ?>
</company>
<?php if (mt_rand(0,5) == 0): ?>
<details>
<![CDATA[<?php echo $generator->lorem(3) ?>]]>
</details>
<?php endif; ?>
</contact>
<?php endfor; ?>
</contacts>