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

Commit

Permalink
Merge pull request #630 from gregoryduckworth/master
Browse files Browse the repository at this point in the history
Add jobTitle generator
  • Loading branch information
fzaninotto committed Feb 23, 2016
2 parents 2e38401 + 6fc91fd commit cae0d90
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 9 deletions.
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,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 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

0 comments on commit cae0d90

Please sign in to comment.