Skip to content

Commit

Permalink
feat: add phone number, company, job title
Browse files Browse the repository at this point in the history
  • Loading branch information
gere-lajos committed Apr 20, 2024
1 parent f2ccaa2 commit 1534ae7
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ $fullFemaleName = $meow->fullFemaleName(); // "Luna Furbridge"
```php
$email = $meow->email(); // "[email protected]"
$emails = $meow->emails(3); // ["[email protected], [email protected], [email protected]"]

$phone = $meow->phone(); // "+61423832405"
$company = $meow->company(); // "Velvet Ventures S.E."
$jobTitle = $meow->jobTitle(); // "Soft Paws Therapist"
```

### Generate words, sentences and paragraphs
Expand Down
3 changes: 3 additions & 0 deletions src/Enums/MiscType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

enum MiscType: string
{
case COMPANY = 'company';
case COMPANY_SUFFIX = 'company_suffix';
case DOMAIN = 'domain';
case JOBTITLE = 'jobtitle';
case LASTNAME = 'lastname';
}
24 changes: 22 additions & 2 deletions src/Meow.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function fullName(NameType $type = NameType::FULL): Item
$firstName = $this->name($type);
$lastName = $this->lastName();

return new Item($firstName.' '.$lastName);
return new Item("$firstName $lastName");
}

public function maleFullName(): Item
Expand All @@ -78,13 +78,33 @@ public function fullNames(int $count = 1): Items
return Randomizer::pickToArray(fn () => $this->fullName(), $count);
}

public function phone(): Item
{
$phone = '+'.mt_rand(1, 9).mt_rand(100, 999).mt_rand(100, 999).mt_rand(1000, 9999);

return new Item($phone);
}

public function company(): Item
{
$company = Randomizer::pick($this->dictionary->misc(MiscType::COMPANY));
$company_suffix = Randomizer::pick($this->dictionary->misc(MiscType::COMPANY_SUFFIX));

return new Item("$company $company_suffix");
}

public function jobTitle(): Item
{
return Randomizer::pick($this->dictionary->misc(MiscType::JOBTITLE));
}

public function email(): Item
{
$adjective = Randomizer::pick($this->dictionary->words(WordType::ADJECTIVE));
$name = $this->name();
$number = mt_rand(1, 999);
$domain = Randomizer::pick($this->dictionary->misc(MiscType::DOMAIN));
$email = strtolower($adjective.'.'.$name.'.'.$number.'@'.$domain);
$email = strtolower("$adjective.$name.$number@$domain");

return new Item($email);
}
Expand Down
3 changes: 3 additions & 0 deletions src/dictionary/misc.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
company:Whisker Widgets,Tabby Tech,Purrfect Products,Feline Finances,Claw Crafts,Mittens Media,Fluffy Fashions,Silky Supplies,Stripe Solutions,Spotlight Snacks,Furrow Foods,Snuggle Softwares,Tailor Textiles,Meow Marketing,Nimble Networks,Paw Print Publishing,Whisper Web,Velvet Ventures,Kitten Kits,Leap Logistics,Purrley Pharmaceuticals,Slinky Services,Blinkwell Beauty,Softpounce Spa,Tufted Textiles,Tiger Tools,Lynx Logistics,Manx Machines,Siamese Systems,Calico Creatives,Tortie Textures,Furbridge Furnishings,Furrish Furnitures,Vanish Valley Vines,Groom Grove Goods,Silkyrun Studios,Whisker Works,Napnest Naturals,Hissington Hardware,Fuzzy Fabrics,Pawprint Paper,Hairholt Hospitality,Catnip Consulting,Stretchstrand Sports,Snuggleshire Sweets,Springpaw Spirits,Purrplace Properties,Quickcliff Quilts,Mewmount Media,Scratchspring Supplies
company_suffix:Inc.,LLC,Ltd.,Co.,Corp.,GmbH,AG,Pty Ltd,S.A.,Oy,AB,AS,B.V.,S.P.A.,S.A.R.L.,Pvt. Ltd.,K.K.,A.S.,Zrt.,T.O.V.,Sdn Bhd,JSC,PLC,C.A.,S.L.,S.A.U.,S.r.l.,OÜ,N.V.,Ltda.,Kft.,A.G.,S.C.A.,e.V.,e.K.,A.E.,G.P.,L.P.,S.E.,S. en C.,C.C.,S.C.S.,K.D.,K.D.A.,G.I.E.,EEIG,Sp.z o.o.,T:mi,A.M.b.A.,R.L.
domain:felinefun.com,purringpet.io,whiskerworld.net,tabbytales.com,fluffyfriends.io,slinkycat.net,curiouscats.com,nimbleneko.io,sleepysiamese.net,playfulpaws.com,stealthystalker.io,silkysoft.net,friskyfelines.com,sprysprings.io,plushpurr.net,alertwhiskers.com,agilealley.io,softsnuggles.net,velvetyvibes.com,gracefulgait.io,mysteriousmeows.net,glossycoat.com,stripedsaga.io,spottedsphynx.net,manxmanner.com,siamesesystem.io,calicocorner.net,tortietalk.com,shaggyshedders.io,bushytails.net,paddedpaws.com,feistyfurballs.io,acrobaticcats.net,elusiveears.com,inquisitiveinstincts.io,snugglysoft.net,dociledome.com,lithelynx.io,cunningcats.net,climbingclaws.com,hairyhackles.io,tuftedtails.net,freckledfur.com,rustlingragdolls.io,twitchingtails.net,blinkingbeauties.com,meowingmavens.io,crouchingcats.net,prowlingpet.com,leapinglynx.io
jobtitle:Chief Purring Officer,Cat Behavior Analyst,Feline Nutritionist,Whisker Consultant,Claw Management Specialist,Meow Marketing Director,Tabby Technician,Siamese Strategist,Fur Quality Inspector,Paw Product Manager,Litter Logistics Coordinator,Tail Talent Scout,Kitten Care Coordinator,Purr Publicist,Feline Fitness Trainer,Catnip Cultivation Expert,Scratching Post Designer,Naptime Network Engineer,Furry Friend Facilitator,Laser Pointer Specialist,Treat Tester,Whisker Welfare Worker,Soft Paws Therapist,Cat Cafe Manager,Agility Trainer for Cats,Rescue Relations Representative,Cat Show Judge,Meow Mixologist,Fluffy Fashion Advisor,Cat Toy Developer,Litter Box Innovator,Scratch Space Architect,Meow Meditation Instructor,Purr Programming Expert,Kitten Kindergarten Teacher,Catography Expert,Veterinary Visionary,Cat Content Curator,Feline Event Planner,Pawsitive Psychologist,Mew-sic Therapist,Cat Grooming Guru,Kitty Yoga Instructor,Paw-pularity Analyst,Furball Forecasting Analyst,Cat Whisperer,Feline Linguist,Scratching Strategist,Cat Community Organizer,Tuft Tactical Advisor
lastname:Whiskerton,Tabbyfield,Purrington,Felinegrove,Clawson,Mittensworth,Fluffmoor,Silkytail,Stripeson,Spottymane,Furrow,Snuggleford,Tailor,Meowman,Nimblewick,Pawster,Whisperwill,Velvetvale,Kittenhall,Leapwood,Purrley,Slinkystreet,Blinkwell,Softpounce,Tuftcorner,Tigerton,Lynxley,Manxmont,Siameseplace,Calicocliff,Tortietown,Furbridge,Furrish,Vanishvale,Groomgrove,Silkyrun,Whiskerwind,Napnest,Hissington,Fuzzyfield,Pawprintpath,Hairholt,Catnipcorner,Stretchstrand,Snuggleshire,Springpaw,Purrplace,Quickcliff,Mewmount,Scratchspring
5 changes: 4 additions & 1 deletion src/playground.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
echo 'More names: ' . implode(', ', $meow->names(5)->toArray()) . PHP_EOL;
echo $separator . PHP_EOL;

// Generate an email
// Generate misc items
echo 'An email: ' . $meow->email() . PHP_EOL;
echo 'More emails: ' . implode(', ', $meow->emails(3)->toArray()) . PHP_EOL;
echo 'A phone number: ' . $meow->phone() . PHP_EOL;
echo 'A company: ' . $meow->company() . PHP_EOL;
echo 'A job title: ' . $meow->jobTitle() . PHP_EOL;

// Generate a word
echo 'A word: ' . $meow->word() . PHP_EOL;
Expand Down
15 changes: 15 additions & 0 deletions tests/MiscTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace GereLajos\MeowMaker\Tests;

use GereLajos\MeowMaker\Enums\MiscType;
use GereLajos\MeowMaker\Meow;
use GereLajos\MeowMaker\Structures\Item;
use GereLajos\MeowMaker\Structures\Items;
Expand All @@ -30,4 +31,18 @@ public function testItCanGenerateMoreEmails(): void
$this->assertInstanceOf(Items::class, $this->meow->emails(10));
$this->assertCount(10, $this->meow->emails(10));
}

public function testItCanGenerateCompany(): void
{
$company = $this->meow->company();
$this->assertInstanceOf(Item::class, $company);
$this->assertIsString((string) $company);
}

public function testItCangenerateJobTitle(): void
{
$jobTitle = $this->meow->jobTitle();
$this->assertInstanceOf(Item::class, $jobTitle);
$this->assertContains((string) $jobTitle, $this->meow->dictionary->misc(MiscType::JOBTITLE));
}
}

0 comments on commit 1534ae7

Please sign in to comment.