PHPackages                             liluoao/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. liluoao/api-doc

AbandonedLibrary[API Development](/categories/api)

liluoao/api-doc
===============

Generate API doc from PHPDoc.

v1.0.0(8y ago)3181MITPHPPHP &gt;=5.4.0

Since Feb 11Pushed 6y agoCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

通过定义PHP Doc规则生成API文档
====================

[](#通过定义php-doc规则生成api文档)

[![Packagist](https://camo.githubusercontent.com/4abc9481d872ed06a85cca9f8abe130eab10ec5d3fb4a4ff5c483df81444b7da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c696c756f616f2f6170692d646f632e737667)](https://packagist.org/packages/liluoao/api-doc)[![](https://camo.githubusercontent.com/7067a8814fe0f53030827ece9b84f639facb78a6cb68b9f758d545e4837f71cd/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3132303939303536322f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/analyses/qr6mbV#)[![Quality Gate Status](https://camo.githubusercontent.com/d9c9407dc6e9b98d62c04e5143e1c10a3f6915782d5933b7b0757b1255e73779/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6c696c756f616f5f6170692d646f63266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard?id=liluoao_api-doc)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#)

### 使用方法：

[](#使用方法)

1. 引入本库

```
composer require liluoao/api-doc

```

2. 实例化核心类

> 第一个参数是需要生成文档的文件夹路径
>
> 第二个参数可选，保存生成文档的路径，默认为当前目录

```
$apiDoc = new \Liluoao\ApiDoc('your-file-folder');
```

3. 配置

> 包括你的文档名，和 `snake_case` 转换 `camelCase` 的配置

```
$apiDoc->setName('doc-name');
$apiDoc->setCamel2SnakeConfig(false, false, 0, 0);
```

4. 执行

```
$apiDoc->init();
```

### 规则:

[](#规则)

> 首行为空
>
> 第二行为描述
>
> 第三行以**api**开头，接上请求方式和URL
>
> 参数备注中不能出现空格，建议替换成标点符号

### 格式示例：

[](#格式示例)

```
/**
 * 组合一句问候
 * api GET /index/hello
 * @param string $name 你想问候的人
 * @param string $say 问候语
 * @return string 组合后的话
 */
public function hello(string $name, string $say): string {
    return "Hello,{$name},{$say}";
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.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

Unknown

Total

1

Last Release

3015d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3f3b036f73cc0fe5e7d2a90bff0dd15aacbcee0896a9adc969129f538b1d3ee?d=identicon)[李罗奥](/maintainers/%E6%9D%8E%E7%BD%97%E5%A5%A5)

---

Top Contributors

[![liluoao](https://avatars.githubusercontent.com/u/16525220?v=4)](https://github.com/liluoao "liluoao (27 commits)")[![mumbaicat](https://avatars.githubusercontent.com/u/34854619?v=4)](https://github.com/mumbaicat "mumbaicat (19 commits)")

---

Tags

api-documentationphpphpdocphpdocapi-documentation

### Embed Badge

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

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

###  Alternatives

[phpdocumentor/phpdocumentor

Documentation Generator for PHP

4.4k3.1M878](/packages/phpdocumentor-phpdocumentor)[apigen/apigen

PHP source code API generator.

2.2k627.9k225](/packages/apigen-apigen)[code-lts/doctum

Doctum, a PHP API documentation generator. Fork of Sami

35077.9k31](/packages/code-lts-doctum)[pronamic/wp-documentor

Documentation Generator for WordPress.

6529.8k5](/packages/pronamic-wp-documentor)[adrenalinkin/swagger-resolver-bundle

Provides possibility for validate data according to Swagger documentation

1013.3k](/packages/adrenalinkin-swagger-resolver-bundle)

PHPackages © 2026

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