为具有相同名称的多个类生成文档?

发布于 2024-12-27 02:15:07 字数 241 浏览 4 评论 0原文

我有一个网络应用程序,它有多个“控制器”文件,这些文件都定义了一个名为“控制器”的类。有一个路由脚本,仅根据页面请求包含正确的文件,然后实例化一个新的“控制器”对象。

在生成 phpDoc 自动文档时,只有第一个“Controller”类会为其生成文档,而定义“Controller”对象的所有其他文件都链接到该“Controller”的定义而不是它们自己的定义。有没有办法强制 phpDoc 为“Controller”类的每个重新定义创建唯一的文档?

I have a webapp that has multiple "Controller" files that all define a class called "Controller". There's a routing script that only includes the proper file depending on the page request, and then instantiates a new "Controller" object.

In generating the phpDoc automatic documentation, only the first "Controller" class gets documentation generated for it, and all other files that define a "Controller" object link to that one definition of "Controller" rather than their own. Is there a way to force phpDoc to create unique documentation for each of the redefinitions of the "Controller" class?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

压抑⊿情绪 2025-01-03 02:15:07

phpDocumentor可以处理这种类名重复,但只能通过将类放在不同的“包”中来实现。

/**
 * MyClass #1
 * @package PackageOne
 */
class MyClass {}

/**
 * MyClass #2
 * @package PackageTwo
 */
class MyClass {}

这将导致两个类在同一个 phpDocumentor 执行中成功记录。

phpDocumentor can handle this kind of class name duplication, but only by putting the classes in different "packages".

/**
 * MyClass #1
 * @package PackageOne
 */
class MyClass {}

/**
 * MyClass #2
 * @package PackageTwo
 */
class MyClass {}

This will result in both classes being documented successfully in the same phpDocumentor execution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文