gerelajos / meowmaker
此包的最新版本(v0.4.0)没有可用的许可信息。
一个用于生成基于猫的假数据的小型包
v0.4.0
2024-04-20 21:38 UTC
Requires (Dev)
- phpunit/phpunit: ^11.1
README
MeowMaker是一个简单的PHP包,用于生成随机猫数据。它适用于数据库测试和初始化。
安装
您可以通过composer安装此包
composer require gerelajos/meowmaker
用法
基本用法
use GereLajos\MeowMaker\Meow; $meow = new Meow(); $name = $meow->name(); // "Whiskers" $names = $meow->names(5); // ["Whiskers", "Mittens", "Fluffy", "Tiger", "Smokey"]
生成名字
$name = $meow->name(); // "Whiskers" $names = $meow->names(5); // ["Whiskers", "Mittens", "Fluffy", "Tiger", "Smokey"] $maleName = $meow->maleName(); // "Whiskers" $maleNames = $meow->maleNames(5); // ["Whiskers", "Mittens", "Fluffy", "Tiger", "Smokey"] $femaleName = $meow->femaleName(); // "Luna" $femaleNames = $meow->femaleNames(5); // ["Luna", "Bella", "Lucy", "Kitty", "Daisy"] $lastName = $meow->lastName(); // "Tabbyfield" $fullName = $meow->fullName(); // "Toby Tabbyfield" $fullMaleName = $meow->fullMaleName(); // "Toby Tabbyfield" $fullFemaleName = $meow->fullFemaleName(); // "Luna Furbridge"
生成地址
$address = $meow->address(); // " Slinkyside, Clawchester, Tabby Crossroad 228, 4725" $country = $meow->country(); // "Purrch Republic" $city = $meow->city(); // "Whisperwind" $street = $meow->street(); // "Meow Highway" $postcode = $meow->postcode(); // "4725" $buildingNumber = $meow->buildingNumber(); // "228"
生成其他项目
$email = $meow->email(); // "agile.chester.461@acrobaticcats.net" $emails = $meow->emails(3); // ["agile.chester.461@acrobaticcats.net, leaping.phoebe.763@dociledome.com, soft.ruby.261@agilealley.io"] $phone = $meow->phone(); // "+61423832405" $company = $meow->company(); // "Velvet Ventures S.E." $jobTitle = $meow->jobTitle(); // "Soft Paws Therapist"
生成单词、句子和段落
$word = $meow->word(); // "meow" $words = $meow->words(5); // ["meow", "purr", "hiss", "yowl", "growl"] $sentence = $meow->sentence(); // "The cat meowed." $sentences = $meow->sentences(5); // ["The cat meowed.", "The cat purred.", "The cat hissed.", "The cat yowled.", "The cat growled."] $paragraph = $meow->paragraph(); // "The cat meowed. The cat purred. The cat hissed." $paragraphs = $meow->paragraphs(5); // ["The cat meowed. The cat purred. The cat hissed.", "The cat yowled. The cat growled. The cat meowed.", "The cat purred. The cat hissed. The cat yowled.", "The cat growled. The cat meowed. The cat purred.", "The cat hissed. The cat yowled. The cat growled."]
项目修改器
项目可以通过多种方式进行修改。例如,您可以
$items->add(Item $item); // Add an item to the collection $items->shuffle(); // Shuffle the items in the collection $items->unique(); // Get only unique items from the collection $items->unique(); // Get only unique items from the collection $items->filter(callable $callback); // Filter the items in the collection
致谢
许可
MIT许可(MIT)。请参阅许可文件以获取更多信息。