如何使用自定义注释在PHP中记录代码

发布于 2025-01-20 20:12:49 字数 551 浏览 4 评论 0原文

在我的PHP代码中,我有很多地方,需要为不同客户自定义编程逻辑的默认行为。出于文档目的,我想宣传每个自定义逻辑。如果工具可以从这些注释中创建诸如phpdocumentator之类的文档,则完美是完美的。学说注释库似乎不合适,因为我不想自动实例化和解析类。

请参阅注释的示例:

        /**
         * @Mytool(
         *     customer=Customer1,
         *     title=set sepa confirmed when calling sepa finalize to immediately confirm payments without bank import
         *     ticket=#2916
         * )
         */
        if ($this->context->isCustomer1()) {
            $mapper->setConfirmed($paymentIds);
        }

有人可以建议搜索工具或关键字吗?

In my php code I have a lot of places, where I need to customize the default behaviour of the programming logic for different customers. For documentation purposes I want to annonate every custom logic. Perfect would be, if a tool can create a documentation like phpdocumentator from those annotations. The doctrine annotation library does not seem to fit, because I do not want to instantiate and parse classes automatically.

See this example of an annotation:

        /**
         * @Mytool(
         *     customer=Customer1,
         *     title=set sepa confirmed when calling sepa finalize to immediately confirm payments without bank import
         *     ticket=#2916
         * )
         */
        if ($this->context->isCustomer1()) {
            $mapper->setConfirmed($paymentIds);
        }

Can someone suggest a tool or keyword to search for?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文