world-warm-worm/autodoc
Composer 安装命令:
composer require world-warm-worm/autodoc
包简介
Generates documentation of classes methods in several file formats
README 文档
README
What can a library do?
Documents methods of any class, regardless of access modifiers, in two json and yaml formats. All you need to
do is call the constructor of the JsonAutodoc or YamlAutodoc class, throw an object of the class into it, the
methods of which need to be documented and comply with the requirement that the documented class implement the
EndpointInterface interface. Where can I call the constructor of the JsonAutodoc or YamlAutodoc class? It depends
on your needs. For example, I'm in my project the JsonAutodoc constructor was called in the constructor body of the
class, which is an API for a third-party service. This way, the documentation is reassembled every time the API
endpoint is called and is always up to date.
Hou to use?
$objectToDocument = new MyClass(); new JsonAutodoc($objectToDocument)->generate( "The documentation of " . $objectToDocument::class . " endpoints", '/path/to/file' ); new YamlAutodoc($objectToDocument)->generate( "The documentation of " . $objectToDocument::class . " endpoints", '/path/to/file' );
Usage examples
/tests/EndpointAutodocTest.php
/src/Api/Product/Controller/ProductController.php
What if my project is written on the symfony/laravel/yii framework?
The library is easily integrated. You can use this approach: if you work on any of the modern MVC frameworks, then generate your own documentation file for each controller. Select another controller, where there will be a list links to the documentation of all other controllers as in the example with the file index.php this library. This way it will be possible for any of the colleagues on the project (not just the programmer) to have an idea of how the controllers in the project or API work.
What if I want to use your library, but my project doesn't have composer?
Download the zip from my repository and unzip the library folder. To work with the library, you will only
need the /src/Autodoc folder, but it uses the namespaces specified in /composer.json in its files. The files may
not be located in your project. Most likely, you will need to replace the library's namespaces with your own.
That's all
If you want to join to develop this project - you are welcome in pull requests. If you find smth not working you are welcome to issues.
world-warm-worm/autodoc 适用场景与选型建议
world-warm-worm/autodoc 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 world-warm-worm/autodoc 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 world-warm-worm/autodoc 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2025-08-26