mrgoodbytes8667/faker-providers
最新稳定版本:v0.6.2
Composer 安装命令:
composer require mrgoodbytes8667/faker-providers
包简介
A Faker Factory, Generator, and some providers
README 文档
README
A Faker Factory, Generator, and some providers
Installation
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Open a command console, enter your project directory and execute:
$ composer require mrgoodbytes8667/faker-providers
Usage
use Bytes\Common\Faker\Factory; $faker = Factory::create(); $faker->camelWords(); $faker->snakeWords(); $faker->oneOrMoreOf(['some', 'iterable', 'object']); $faker->rangeBetween(4, 1, 2); $faker->randomAlphanumericString(); $faker->paragraphsMinimumChars();
The included replacement Factory removes the now deprecated Faker image provider and replaces it with the mmo/faker-images provider, and adds other included providers by default. It returns an overloaded Generator for code completion purposes as well.
With PHPUnit
See test-common-faker for easy PHPUnit test integration
With Zenstruck/Foundry
Add the following to Kernel.php to replace the default Faker Generator with this one, adding in these providers
public function process(ContainerBuilder $container): void { $container->getDefinition('.zenstruck_foundry.faker')->setFactory([\Bytes\Common\Faker\Factory::class, 'create']); }
License
Faker Providers by MrGoodBytes is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
Based on a work at https://github.com/mrgoodbytes8667/faker-providers.
统计信息
- 总下载量: 2.55k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: CC-BY-NC-4.0
- 更新时间: 2024-08-02