function DeprecatedAnnotationDeclarationSniff::process
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
Parameters
int $docCommentStartPointer:
Overrides Sniff::process
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Commenting/ DeprecatedAnnotationDeclarationSniff.php, line 28
Class
Namespace
SlevomatCodingStandard\Sniffs\CommentingCode
public function process(File $phpcsFile, $docCommentStartPointer) : void {
/** @var list<Annotation<DeprecatedTagValueNode>> $annotations */
$annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentStartPointer, '@deprecated');
if (count($annotations) === 0) {
return;
}
foreach ($annotations as $annotation) {
if ($annotation->getValue()->description !== '') {
continue;
}
$phpcsFile->addError('Deprecated annotation must have a description.', $annotation->getStartPointer(), self::MISSING_DESCRIPTION);
}
}