PEAR 标准有文件和类注释代码嗅探,我不确定它们如何交互。
PEAR 类注释检查的第一部分是
$commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true);
if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG
&& $tokens[$commentEnd]['code'] !== T_COMMENT
) {
$phpcsFile->addError('Missing class doc comment', $stackPtr, 'Missing');
$phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'no');
return;
}
但是当出现以下文件时,它会传递,因为它(可能)认为文件注释是类注释。以前有没有人遇到过这种情况,如果有,您是如何克服的?谢谢
/**
*
* PLATFORM 3 - APACS 29b Recurring Transaction Update Service (RTUS)
* ==================================================================
*
* This class provides the encoding and decoding of recurring transaction update
* service enquiry and response files that use the APACS 29b protocol as defined
* in APACS Standard 70 Book 3.
*
* @package Cardstream
* @subpackage Pro/System/Classes
* @copyright Copyright (c) 2011 - Cardstream Ltd.
* @author Nick Turner <nick.turner@cardstream.com>
* @link http://www.cardstream.com
* @version $Id: p3apacsrtus.php 8195 2016-09-28 13:36:50Z chris.wilson $
*/
class testClass {
}