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
Installation
composer require --dev samlitowitz/php-collection-generator
Usage
-
Create a configuration targeting the type(s) you wish to generate a collection for.
-
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
\Countable\Iterator\JsonSerializable
Additional Methods
The generated collection includes the following methods in addition to those needed to fulfil the above interfaces
public function toArray(): arraypublic function add(\Fully\Qualified\Namespace\Type ...$entities): void
Future Features
- Output File Formatting
- Configuration options
- type-hint member variables
- inline
- as comment
- type-hint member variables
- Configuration options
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2022-07-22