PHPackages                             leruge/tp6-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. leruge/tp6-doc

Abandoned → [leruge/doc](/?search=leruge%2Fdoc)Library

leruge/tp6-doc
==============

简化swagger注释写法

1.0.5(4y ago)2489[1 issues](https://github.com/leruge/tp6-doc/issues)MITPHPPHP ^7.4

Since Nov 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/leruge/tp6-doc)[ Packagist](https://packagist.org/packages/leruge/tp6-doc)[ RSS](/packages/leruge-tp6-doc/feed)WikiDiscussions main Synced today

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

tp6-doc
=======

[](#tp6-doc)

swagger的接口文档注释太难写，封装一个好写注释的

安装
--

[](#安装)

```
composer require leruge/tp6-doc
```

使用说明
----

[](#使用说明)

1. 下载完成以后会自动在config目录生成一个doc.php配置文件，如果没有请手动创建

```
return [
    // 文档标准
    'swagger' => '2.0', // 目前仅支持2.0
    'title' => '文档名称',
    'version' => '1.0.1',
    'debug' => true, // 打开调式模式则每次都生成一次文档

    // code字段标识含义
    'code_desc' => [
        1 => '请求成功',
        0 => '请求失败'
    ],

    // 需要生成文档的控制
    'controller' => [
        \app\controller\Foo::class,
    ],
];
```

注释说明
----

[](#注释说明)

```
/**
     * @title 接口文档
     * @url /api/demo
     * @method post
     *
     * @param name:phone type:string require:1 desc:手机号 default:17000000001
     *
     * @return count:数量（单个字段）
     * @return user_info:一条数据@!
     * @user_info id:用户ID nickname:昵称
     * @return article_list:文章列表，多条数据@
     * @article_list is:文章ID title:标题
     */
```

类和方法
----

[](#类和方法)

1. 接口以类为单位进行自动分组
2. 类的注释只有title
3. 方法的注释必须有title、url、method，参数param和响应值return，看你自己需求

访问地址
----

[](#访问地址)

1. 访问地址为：你的域名+doc

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~51 days

Total

5

Last Release

1808d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b2518593dfbc67ba8bc8e39bb30541fa3d8a7002f87240f2f8a6b99f26e4c9eb?d=identicon)[leruge@163.com](/maintainers/leruge@163.com)

---

Top Contributors

[![leruge](https://avatars.githubusercontent.com/u/33196309?v=4)](https://github.com/leruge "leruge (6 commits)")

### Embed Badge

![Health badge](/badges/leruge-tp6-doc/health.svg)

```
[![Health](https://phpackages.com/badges/leruge-tp6-doc/health.svg)](https://phpackages.com/packages/leruge-tp6-doc)
```

###  Alternatives

[topthink/think

the new thinkphp framework

8.0k1.2M13](/packages/topthink-think)[topthink/think-queue

The ThinkPHP6 Queue Package

640675.0k75](/packages/topthink-think-queue)[topthink/think-swoole

Swoole extend for thinkphp

477174.4k19](/packages/topthink-think-swoole)[topthink/think-captcha

captcha package for thinkphp

132934.4k68](/packages/topthink-think-captcha)[topthink/think-worker

workerman extend for thinkphp

202227.2k9](/packages/topthink-think-worker)[topthink/think-migration

96460.8k121](/packages/topthink-think-migration)

PHPackages © 2026

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