Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RequireOneLinePropertyDocCommentSniff.php

function RequireOneLinePropertyDocCommentSniff::addError

Overrides AbstractRequireOneLineDocComment::addError

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/RequireOneLinePropertyDocCommentSniff.php, line 47

Class

RequireOneLinePropertyDocCommentSniff

Namespace

SlevomatCodingStandard\Sniffs\Commenting

Code

protected function addError(File $phpcsFile, int $docCommentStartPointer) : bool {
    $error = 'Found multi-line comment for property %s with single line content, use one-line comment instead.';
    
    /** @var int $propertyPointer */
    $propertyPointer = $phpcsFile->findNext(T_VARIABLE, $docCommentStartPointer);
    return $phpcsFile->addFixableError(sprintf($error, PropertyHelper::getFullyQualifiedName($phpcsFile, $propertyPointer)), $docCommentStartPointer, self::CODE_MULTI_LINE_PROPERTY_COMMENT);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal