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

Breadcrumb

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

function RequireConstructorPropertyPromotionSniff::isPropertyDocCommentUseful

1 call to RequireConstructorPropertyPromotionSniff::isPropertyDocCommentUseful()
RequireConstructorPropertyPromotionSniff::process in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireConstructorPropertyPromotionSniff.php
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireConstructorPropertyPromotionSniff.php, line 316

Class

RequireConstructorPropertyPromotionSniff

Namespace

SlevomatCodingStandard\Sniffs\Classes

Code

private function isPropertyDocCommentUseful(File $phpcsFile, int $propertyPointer) : bool {
    if (DocCommentHelper::hasDocCommentDescription($phpcsFile, $propertyPointer)) {
        return true;
    }
    foreach (AnnotationHelper::getAnnotations($phpcsFile, $propertyPointer) as $annotation) {
        $annotationValue = $annotation->getValue();
        if (!$annotationValue instanceof VarTagValueNode) {
            return true;
        }
        if ($annotationValue->description !== '') {
            return true;
        }
    }
    return false;
}

API Navigation

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