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

Add jobTitle generator #630

Merged
merged 2 commits into from
Feb 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ Each of the generator properties (like `name`, `address`, and `lorem`) are calle
bs // 'e-enable robust architectures'
company // 'Bogan-Treutel'
companySuffix // 'and Sons'
jobTitle // 'Cashier'

### `Faker\Provider\en_US\Text`

Expand Down
1 change: 1 addition & 0 deletions src/Faker/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*
* @property string $company
* @property string $companySuffix
* @property string $jobTitle
*
* @property string $creditCardType
* @property string $creditCardNumber
Expand Down
14 changes: 14 additions & 0 deletions src/Faker/Provider/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class Company extends \Faker\Provider\Base

protected static $companySuffix = array('Ltd');

protected static $jobTitleFormat = array(
'{{word}}',
);

/**
* @example 'Acme Ltd'
*/
Expand All @@ -27,4 +31,14 @@ public static function companySuffix()
{
return static::randomElement(static::$companySuffix);
}

/**
* @example 'Job'
*/
public function jobTitle()
{
$format = static::randomElement(static::$jobTitleFormat);

return $this->generator->parse($format);
}
}
Loading