承接 mmouih/entity-generator 相关项目开发

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

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

mmouih/entity-generator

最新稳定版本:v1.0.2

Composer 安装命令:

composer require --dev mmouih/entity-generator

包简介

A tool designed to streamline the conversion of payloads (json, xml or yaml) into class entities

README 文档

README

The Entity Generator is a tool designed to streamline the conversion of payloads into class entities for PHP applications running on PHP 7 and beyond. The generated entities adhere to the PSR-12 coding standards, ensuring a clean and consistent codebase.

This tool is particularly valuable for swiftly transforming payloads into Data Transfer Objects (DTOs), enhancing your PHP application's flexibility and efficiency.

Requirements

  • PHP 8.2 or higher

Usage

To leverage the Entity Generator, use the following command:

Using Json file

./phpgen generate [EntityName] [Payload] --f

Using Json string

./phpgen generate [EntityName] [Json] "json" 

Or simply

./phpgen generate [EntityName] [Json]

Example:

./phpgen generate User '{"id": 1, "label": "john"}'

Using XML file

./phpgen generate [EntityName] [filepath] "xml" -f

Using XML string

./phpgen generate [EntityName] [XML] "xml" 

Using Yaml file

./phpgen generate [EntityName] [filepath] "xml" -f

Configuration file

You can use customized entity generation options using a configuration a below,

#config.yaml.dist
entity.generator:
    output.dir: 'var/generated'
    namespace: 'Entity\Generated'
    property.phpdoc: true
    property.type: true # false before php7.4
./phpgen generate [EntityName] [filepath] "xml" -f -c path/to/config.yaml.dist

If config file is not configured, default options (config.yaml.dist) will be used.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-30