function ClassCommentSniff::processVersion
Process the version tag.
Parameters
\PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.:
array $tags The tokens for these tags.:
Return value
void
Overrides FileCommentSniff::processVersion
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Standards/ PEAR/ Sniffs/ Commenting/ ClassCommentSniff.php, line 102
Class
Namespace
PHP_CodeSniffer\Standards\PEAR\Sniffs\CommentingCode
protected function processVersion($phpcsFile, array $tags) {
$tokens = $phpcsFile->getTokens();
foreach ($tags as $tag) {
if ($tokens[$tag + 2]['code'] !== T_DOC_COMMENT_STRING) {
// No content.
continue;
}
$content = $tokens[$tag + 2]['content'];
if (strstr($content, 'Release:') === false) {
$error = 'Invalid version "%s" in doc comment; consider "Release: <package_version>" instead';
$data = [
$content,
];
$phpcsFile->addWarning($error, $tag, 'InvalidVersion', $data);
}
}
}