【问题标题】:Missing file doc comment?缺少文件文档注释?
【发布时间】:2015-12-04 01:14:25
【问题描述】:

我使用了 drupal coder 模块来检查我的代码,并且总是将缺少文件 doc 作为错误。 我使用了以下文件文档注释,但仍然显示错误。你能指导我我做错了什么吗? 编辑

 <?php

/**
 * @file
 * Description
 */


/**
 * Implements hook_menu().
 *
 * Description
 *
 * @return array An array of menu items
 */
function hook_menu() {
 //My code
}

【问题讨论】:

标签: drupal codesniffer


【解决方案1】:

文件的典型前 15 行:

<?php

/**
 * @file
 * Description of what this module (or file) is doing.
 */

/**
 * Implements hook_help().
 */
function yourmodule_help($path, $arg) {
  // or any other hook...
}

不要忘记用 /** 注释你文件的第一个函数,否则编码器会认为你的 @file 注释是你的第一个函数的注释。

【讨论】:

  • 我无权这样做。请在下面查看我的文件代码:&lt;?php /** * @file * Description of file */ /** * Implements hook_menu(). * * Description of function * * @return array An array of menu items */ function lr_social_login_menu() { //My code }
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-11-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-04-01
  • 2013-09-17
相关资源
最近更新 更多