php 读取文件类 注释,PHP代码嗅探器没有提取文件,类和功能文档注释

我正在努力将PHPCS实现到我的构建脚本中,并且相对容易地解决了所有错误和警告(以及SO的一些帮助:)).

但是,我无法弄清楚为什么我仍然得到一个ERROR,说该类缺少文件,类和函数doc注释.

----------------------------------------------------------------------

FOUND 7 ERRORS AFFECTING 7 LINES

----------------------------------------------------------------------

2 | ERROR | Missing file doc comment

28 | ERROR | Missing class doc comment

45 | ERROR | Missing function doc comment

59 | ERROR | Missing function doc comment

73 | ERROR | Missing function doc comment

88 | ERROR | Missing function doc comment

102 | ERROR | Missing function doc comment

----------------------------------------------------------------------

这是PHP类:

<?php

/**

* EndpointHelper File Doc Comment

*

* @category EndpointHelper

* @package Helper

* @author Brian Smith

* @copyright Copyright 2015 Company, Inc. All rights reserved.

* @license GNU General Public License version 2 or later; see LICENSE

* @link http://arctg.com

*/

/**

* EndpointHelper Class Doc Comment

*

* Endpoint Helper to retrieve application wide

* URLs based on active webinstance.

*

* @category Class

* @package EndpointHelper

* @author Brian Smith

* @copyright Copyright 2015 Company, Inc. All rights reserved.

* @license GNU General Public License version 2 or later; see LICENSE

* @link http://company.com

*

* @since 1.0.1

*/

class EndpointHelper

{

/**

* Component params object

*

* @var type

* @since 1.0.1

*/

private static $params = false;

/**

* Retrieve Reservation URL based on web instance

*

* @return String

*

* @since 1.0.1

*/

public static function getReservationUrl()

{

$instance = self::getInstanceType();

return self::$params->get($instance . '_reservation_api_url');

}

/**

* Retrieve Rental URL based on web instance

*

* @return String

*

* @since 1.0.1

*/

public static function getRentalUrl()

{

$instance = self::getInstanceType();

return self::$params->get($instance . '_rental_api_url');

}

/**

* Retrieve cache URL based on web instance

*

* @return String

*

* @since 1.0.1

*/

public static function getCacheUrl()

{

$instance = self::getInstanceType();

return self::$params->get($instance . '_data_cache_api_url');

}

/**

* Retrieve Systems Staging File Sync URL based on web

* instance.

*

* @return String

*

* @since 1.0.1

*/

public static function getFileSyncUrl()

{

$instance = self::getInstanceType();

return self::$params->get($instance . '_file_sync');

}

/**

* Private utilty class to retrieve current web instance

*

* @return String

*

* @since 1.0.1

*/

private static function getInstanceType()

{

if (!self::$params)

{

self::$params = JComponentHelper::getParams('com_custom');

}

return self::$params->get('web_instance');

}

}

谢谢你的帮助!!

解决方法:

这个问题与我在Joomla使用的规则集有关.我最近采取了另一种方法来使其工作,Wiki的作者更新了文章,说明您需要使用特定版本的PHP Docs.

清除现有安装并安装列出的版本为我解决了问题.

标签:php,phpcodesniffer

来源: https://codeday.me/bug/20190711/1433718.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值