承接 daavelar/faker-json 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

daavelar/faker-json

最新稳定版本:2.0.6

Composer 安装命令:

composer require daavelar/faker-json

包简介

README 文档

README

Faker Json is a library in PHP that uses the Faker library to generate valid JSONs from templates with variables. The idea is to replace variables in the format ${variable} or method(arguments) with values generated by the Faker library.

Installation

composer require daavelar/faker-json

Usage

use Faker\Factory;
use FakerJson\FakerJson;

$fakerJson = new FakerJson($faker);

$template = '{
    "name": "firstName",
    "email": "email",
    "phone": "phoneNumber",
    "age": "numberBetween(18, 65)"
    "company": {
        "name": "companyName",
        "address": "streetAddress",
        "bs": "buildingNumber"
    }
}';

$json = $fakerJson->generate($template);

echo $json;

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-06-07