aharisu/generate-form-request-phpdoc
Composer 安装命令:
composer require aharisu/generate-form-request-phpdoc
包简介
Generate PHPDoc properties automatically based on the rules specification of the FormRequest class
README 文档
README
Generate PHPDoc properties automatically based on the rules specification of the FormRequest class.
Installation
composer require --dev aharisu/generate-form-request-phpdoc
Usage
php artisan form-request:generate
Outputs the PHPDoc of the classes inheriting from FormRequest in the app/Http/Requests directory to an external file (e.g. _form_request_phpdoc.php).
For example
<?php namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class FooRequest extends FormRequest { public function rules() { return [ 'id' => ["required", "integer"], 'int_value' => ["nullable", "integer"], 'numeric_value' => ["required", "numeric"], 'string_value' => ["required", "string"], 'bool_value' => ["nullable", "boolean"], 'json_value' => ["required", "json"], 'indexed_array' => ["required", "array"], 'indexed_array.*' => ["required", "string"], 'shaped_array' => ["nullable", "array"], 'shaped_array.id' => ["required", "int"], 'shaped_array.name' => ["required", "string"], 'shaped_array.thumbnail' => ["nullable", "file"], ]; } }
namespace App\Http\Requests { /** * @property-read int $id * @property-read ?int $int_value * @property-read int|float $numeric_value * @property-read string $string_value * @property-read ?bool $bool_value * @property-read mixed $json_value * @property-read string[] $indexed_array * @property-read ?array{id: int, name: string, thumbnail: ?\Illuminate\Http\UploadedFile} $shaped_array */ class FooRequest extends \Illuminate\Foundation\Http\FormRequest {} }
Arguments
--writeWrite PHPDoc directly to your FormRequest file
Target specification
You can specify the output target by the class name with namespace or the file path.
php artisan form-request:generate App\Http\Requests\FooRequest
php artisan form-request:generate app/Http/Requests/FooRequest.php
Multiple specifications are also possible.
php artisan form-request:generate App\Http\Requests\FooRequest app/Http/Requests/BarRequest.php
Other settings
php artisan vendor:publish --provider="aharisu\GenerateFormRequestPHPDoc\GenerateFormRequestPhpdocServiceProvider"
You can change some behaviors in config/generate-form-request-phpdoc.php.
License
Apache 2.0 & MIT
aharisu/generate-form-request-phpdoc 适用场景与选型建议
aharisu/generate-form-request-phpdoc 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.4k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 04 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「phpdoc」 「php」 「type」 「laravel」 「generate」 「formrequest」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aharisu/generate-form-request-phpdoc 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aharisu/generate-form-request-phpdoc 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aharisu/generate-form-request-phpdoc 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A bundle providing fields for image upload with jquery upload and image cropping with jcrop for symfony2
A simple tool for checking that your PHP classes and methods use PHPDocs (PHP DocBlocks Checker fork).
A simple Symfony bundle that adds boolean form field type.
A PHP Abstract Enum Class
Laravel package that generates RESTful API documentation in Markdown based on PHPDoc.
This package provides type-safe extension of the laravel collection, forcing a single type of object.
统计信息
- 总下载量: 2.4k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2023-04-12