The PEAR standard has File and Class comment code sniffs and I am uncertain as to how they interact.
The first part of the PEAR class comment check is
$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;
}
But when presented with the following file it passes as it (presumably) thinks that the file comment is the class comment. Has anyone encountered this before and if so how did you overcome it? Thanks
/**
*
* 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 {
}