PHPackages                             psr4/reflection-api-doc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. psr4/reflection-api-doc

ActiveLibrary[API Development](/categories/api)

psr4/reflection-api-doc
=======================

一个基于 Thinkphp5.1 的 api 文档自动生成工具

v1.4(6y ago)153MITHTMLPHP &gt;=5.3.0

Since Oct 9Pushed 6y agoCompare

[ Source](https://github.com/psr4/reflection_api_doc)[ Packagist](https://packagist.org/packages/psr4/reflection-api-doc)[ RSS](/packages/psr4-reflection-api-doc/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

reflection\_api\_doc
====================

[](#reflection_api_doc)

将会是一个基于 thinkphp5.1 的PHP自动生成api文档的库

1. 安装：

> composer require "psr4/reflection-api-doc"

2. 使用方法

> php think reflection:config

会在 application/config 目录下创建文件名为 documents.php 的配置文件。

**重点:** class 为将要生成文档的类(带命名空间)

2. 示例：

注释参数含义说明@title标题文档生成的类方法标题@desc描述格式如下，地址、请求方式、备注等@param接收参数格式如下，type *?-*?name default desc@return返回参数格式如下，type *?-*?name desc@route注解路由tp5.1的注解路由类的具体实现方法：```
/**
 * @title 文章接口管理
 */
class Article extends Controller
{
    /**
     * @title 获取文章列表

     * @desc  1.接口地址：http://open.opqnext.com/index.php?c=article&a=index
     * @desc  2.请求方式：GET
     * @desc  3.接口备注：必须传入keys值用于通过加密验证

     * 传参格式   1.类型(int,string....)   2.名称(例子:page)第一个为*则必填  3.默认值(任意字符串不带空格)  4.描述(任意字符串)
     * @param int *page 1 页数
     * @param string *keys xxx 加密字符串,substr(md5(\"约定秘钥\".$page),8,16)
     * @param string word  null 搜索关键字
     * @param int cate  0 分类ID,不传表示所有分类
     * @param int size  5 每页显示条数，默认为5

     * 返回值格式   1.类型(int,string....)   2.名称(例子:page)第一个为*则必填  开头-号的数量代表层级  3.描述(任意字符串
     * @return int *-status 返回码：1成功,0失败
     * @return string *-message 返回信息
     * @return array *-data 返回数据
     * @return string *--id 文章ID(22位字符串)
     * @return string *--title 文章标题
     * @return string *--thumb 文章列表图
     * @return text *--content 文章内容
     * @return int *--cate 文章分类
     * @return array *--tags 文章标签
     * @return string *---id 标签ID
     * @return string *---tag 标签名称
     * @return int *---count 标签使用数
     * @return array *--img 文章组图
	 * @route('index', 'get')
     */
    public function index(){
        //... 具体实现方法
    }

```

编辑好配置文件之后 直接打开浏览器访问  即可看到文档页。

3. 预览

长相一般的苹果绿：

[![](https://camo.githubusercontent.com/2e2b1eecd7c62bb9bfdf4ec6cac639773c034a5edd2640844931d573c6919797/68747470733a2f2f696d6167652e6f70716e6578742e636f6d2f6170706c652e6a7067)](https://camo.githubusercontent.com/2e2b1eecd7c62bb9bfdf4ec6cac639773c034a5edd2640844931d573c6919797/68747470733a2f2f696d6167652e6f70716e6578742e636f6d2f6170706c652e6a7067)

长相也一般的葡萄紫：

[![](https://camo.githubusercontent.com/1ebf478c43bd0cf7529856adc983ef406621f4216723c607274ee4ee88bf266b/68747470733a2f2f696d6167652e6f70716e6578742e636f6d2f67726170652e6a7067)](https://camo.githubusercontent.com/1ebf478c43bd0cf7529856adc983ef406621f4216723c607274ee4ee88bf266b/68747470733a2f2f696d6167652e6f70716e6578742e636f6d2f67726170652e6a7067)

[![](https://camo.githubusercontent.com/05ee93ca34b445bccf6446acf665b63fda6adea8a5fec9e49fd4caf5ae40fb4b/68747470733a2f2f696d6167652e6f70716e6578742e636f6d2f67726170655f322e706e67)](https://camo.githubusercontent.com/05ee93ca34b445bccf6446acf665b63fda6adea8a5fec9e49fd4caf5ae40fb4b/68747470733a2f2f696d6167652e6f70716e6578742e636f6d2f67726170655f322e706e67)

4. 支持

如果有使用自动生成文档的需求或者之类的，欢迎加入 QQ群:452209691 共同探讨。

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

3

Last Release

2403d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/011a0bb53cec28385c6fb80d882ab0c376554ea182a55b87e855bc95163774f2?d=identicon)[psr4](/maintainers/psr4)

---

Top Contributors

[![psr4](https://avatars.githubusercontent.com/u/26401410?v=4)](https://github.com/psr4 "psr4 (11 commits)")[![opqnext](https://avatars.githubusercontent.com/u/13477243?v=4)](https://github.com/opqnext "opqnext (1 commits)")

---

Tags

phpapi-doc

### Embed Badge

![Health badge](/badges/psr4-reflection-api-doc/health.svg)

```
[![Health](https://phpackages.com/badges/psr4-reflection-api-doc/health.svg)](https://phpackages.com/packages/psr4-reflection-api-doc)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
