samlitowitz/php-collection-generator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

samlitowitz/php-collection-generator

最新稳定版本:2.0.0

Composer 安装命令:

composer create-project samlitowitz/php-collection-generator

包简介

A tool to generate PHP collection implementations

README 文档

README

Generate type-safe PHP collections!

Table of Contents

  1. Installation
  2. Usage
    1. Configuration
  3. Collection Interfaces and Additional Methods
    1. Interfaces
  4. Future Features

Installation

composer require --dev samlitowitz/php-collection-generator

Usage

  1. Create a configuration targeting the type(s) you wish to generate a collection for.

  2. Generate the desired collection(s) by running the following command

    ./vendor/bin/php-collection-generator --config /path/to/php-collection-generator.json generate /path/to/output/dir

Configuration

A JSON schema for the configuration is available here. The TypeCollection is generated using the example configuration.

Collection Interfaces and Additional Methods

Interfaces

The generated collection will implement the following interfaces

  1. \Countable
  2. \Iterator
  3. \JsonSerializable

Additional Methods

The generated collection includes the following methods in addition to those needed to fulfil the above interfaces

  1. public function toArray(): array
  2. public function add(\Fully\Qualified\Namespace\Type ...$entities): void

Future Features

  1. Output File Formatting
    1. Configuration options
      1. type-hint member variables
        1. inline
        2. as comment

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2022-07-22